Question: write a java program that a passenger can choose only available seat. Use an array of primitive type Boolean to represent the seating chart of

write a java program that a passenger can choose only available seat. Use an array of primitive type Boolean to

represent the seating chart of the bus, where seat number starts from 1 to 10. Seat A

allocated for single seat, while B and C are allocated for double seat. Initialize all the elements

of the array to false to indicate that all the seats are empty.

As each seat is assigned, set the corresponding element of the array to true to indicate that

the seat is no longer available.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!