Originally Posted by
matinthehat
Here you go but this isn't finished, I am just trying to get this part to work correctly.
I'm sorry if it's a really poor attempt.
OK, well, you originally said:
I need to go through the array and only change one of the false elements to true each time, so if a false element is found and turned to true; the loop needs to stop and continue once more input is received.
There are a couple of things to note about the way you put this problem. First, think about how the input relates to the logic of the program. If you have to continue a loop as long as there is input, I would think that input somehow controls the loop. If the input is a seat number, then you would check if the seat is available and give that person a seat if it is, or ask them where else they should sit. You have to do that until everyone has a place to sit.
So:
Code:
while there is input available:
check if there are seats available:
if not, break
else:
ask for a seat
check if that seat is available
if it is, seat the person
if not, repeat
Have fun coding that.