Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
A program that will create a movie seat reservation. The program will display the summary seats and its status. The user will be ask what seat no. to be reserved, then it will go back again to the summary to display the updated seat status. If the seat no. is already reserved then it will prompt an error message. And also if the input seat no is out of range then it will also prompt an error message. The program is continuously running. Termination of the program will depends on how the programmer will apply.

What I have tried:

I have tried using arrays. and Do-While statement but my programs ends in a infinite loop
Posted
Updated 27-Mar-16 18:03pm
v3
Comments
Patrice T 27-Mar-16 7:57am    
Looks like HomeWork
Show your code. explain problem.
Member 12419036 27-Mar-16 8:16am    
I have typed any code yet, since I really can't figure it out. I have an algo/logic in mind but I can't put it in to code (Sorry :( )
Patrice T 27-Mar-16 8:53am    
the problem is in cide you don't want to show.
Member 12419036 27-Mar-16 8:23am    
Can you help me? :)
[no name] 27-Mar-16 8:00am    
a.) "I have tried using Arrays": One should be enough
b.) "....ends in a infinite loop": Under which condition(s)? Already tried to use a debugger?

1 solution

"I have an algo in mind but I can't put it into code."

Well, then get some paper and a pen and follow your algorithm manually.
The paper is the variables you need, and you are the code - so write down each step of what you have to do to make it work yourself.
Then it should be obvious what "arrays" and "loops" you are going to need, so you can start implementing them. Start small, and test each bit as you go on.
So write the code to set everything up, and use the debugger to test it works.
Then write code to print out the current reservations, and make sure it works.
Then start writing the other functions, and test each as you go.

This is your homework, not ours - and you won't learn how to do this on more complex tasks unless you learn how to do this on relatively trivial ones like this! So sit down, think about what you are doing, and make a start.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900