smart parking system coding help needed

The think is you should never jump to conclusions without knowing anything about a person.This project is a mixed group project my electrical part has already been completed by me and the part which i am asking in this forum was supposed to be done by the CS department student ,but clearly since he wasnt doing it ,I am trying my best so that i can complete it.

Fine means its working properly , since I have two seperate sensors and motors for the two gates, i can open them both simultaneously.But if you still say that its not possible due to the coding then even I dont know how its happening.
Regarding str[5], i know array starts from 0 and stores value in each position , char array stores a characted in each position.
And string can be used to store a sentence or even characters, but when i used to use C i remeber i used to use array without specifying limit example array[], but this gave me an error in arduino ide
So I thought of keeping it 4 the same as slot but then gave it 5.

Regarding if statement, I saw some examples on boolean and concluded from them that they work only for the true condition
Under the true condition its < 8 so its means the parking slot is occupied which is what i wanted in the first place so that i can print that the other parkings are free.