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
Get step-by-step solutions from verified subject matter experts
