Carcophan
12-17-2004, 04:03 PM
I am sure many of you have seen the 'Airline seating reservation' assignment that C++ classes give out. I would like to state that I am NOT asking people to do it for me, although I am having a problem getting it to work properly and would greatly appreciate some help.
For those of you who don't know the assignment is... "A small airline company has one 10 seat plane and needs a reservation system. The program should use a menu display to decide if the customer wants economy or first class seating (1-5 for FC, 6-10 for eco). The program needs to print a boarding pass with the assigned section and seat in it. Use a single-subscripted array to represent the seating chart and initialize each seat to 0 to indicate that the seat is empty. Program shouldnt assign a seat that is taken blah blah...but when a section is full the program should ask if a seat in the opposing section is okay and assign that, if they choose no or both sections are full the program should suggest taking the next flight."
That said...my problem is:
I can get the program to recognize that the first class section is full when it gets full and it promts the user to either take a economy seat or take the next flight. BUT when the economy section is full it doesnt suggest First class or the next flight. It does stop counting seats at 10, but once at 10 it just keeps asking if I would like to reserve another FC seat econo seat or -1 to end. The code for both first class and econmy should pretty much be the same and I simple can not see why it doesnt work right.
I'm not sure if i should post all the code here, incase other students are here, I dont want to do there project for them, but I would be more then happy to email it to you. Any help would be appreciated and it is due monday so i'm in a bit of a bind.
Thanks.
For those of you who don't know the assignment is... "A small airline company has one 10 seat plane and needs a reservation system. The program should use a menu display to decide if the customer wants economy or first class seating (1-5 for FC, 6-10 for eco). The program needs to print a boarding pass with the assigned section and seat in it. Use a single-subscripted array to represent the seating chart and initialize each seat to 0 to indicate that the seat is empty. Program shouldnt assign a seat that is taken blah blah...but when a section is full the program should ask if a seat in the opposing section is okay and assign that, if they choose no or both sections are full the program should suggest taking the next flight."
That said...my problem is:
I can get the program to recognize that the first class section is full when it gets full and it promts the user to either take a economy seat or take the next flight. BUT when the economy section is full it doesnt suggest First class or the next flight. It does stop counting seats at 10, but once at 10 it just keeps asking if I would like to reserve another FC seat econo seat or -1 to end. The code for both first class and econmy should pretty much be the same and I simple can not see why it doesnt work right.
I'm not sure if i should post all the code here, incase other students are here, I dont want to do there project for them, but I would be more then happy to email it to you. Any help would be appreciated and it is due monday so i'm in a bit of a bind.
Thanks.