Question: Write a java program that passenger can choose only available seat in a bus. Use an array of primitive type boolean to represent the seating

Write a java program that passenger can choose only available seat in a bus. 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

3.41 Rating (151 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

JAVA import javautilScanner public class BusSeatingChart public static void mainString arg... View full answer

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 Programming Questions!