0

I have started training in writing algorithms. I get forums and answer. but I want cleririty on the pseudocode I have writing.
The questions asks to write a pogram which will assign seats in a flight(capacity of 10 seats).my program should include;first class and economy class-assigning seats 1 to 5 and 6 to 10, for First class and economy class respectively.
-A bording pass should be printed indicating seat number, class type.
-Also if First class is full, the program should provide options for Economy class and viseversa. But a seat should not be assigned after it has been assigned.
-If yes then assign seats approprietly Else If no print "Next Flight leaves in five hours".

My Algorithms in Pseudocode.

SET FirstClass=o
SET Economy (will recieve yours thaks)

2
Contributors
1
Reply
2
Views
10 Years
Discussion Span
Last Post by evilfruitsmashe
0

Are you just trying to create the pseudocode or an actual program? What I would do is create a size 10 array to cover your seats, the values of each of the items in the array are all set to 1 to begin with, meaning that there are all open seats. The values are changed to 0 if the seat is assigned to someone. Then simple looping will take care of finding out if there are available seats and if you need to recommend seating in the other area of the plane. Also, if all values in the array are 0 then you can have it print "Next flight leaves in five hours."

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.