Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please write it only in JAVA and comments will be appreciated. Write a program that can be used to assign seats for a commercial airplane.
Please write it only in JAVA and comments will be appreciated.
Write a program that can be used to assign seats for a commercial airplane. The airplane has 13 rows, with 6 seats in each row. Rows 1 and 2 are first class, rows 3 to 7 are business class, and rows 8 to 13 are economy class. Your program prompts the user to enter the following information: Ticket type (first class, business class, or economy class) Desired seat a. b. Output the seating plan in the following format: A B C D E F Row 1 *X* x x Row 2*X*X*X Row 3 * Row 4 x* x * x x Row 5* X*X * * Row 6*X***X Row 7X X X Row 8 *X* Row 1O * XX X X Row 11 X * X * Row 12** X X *X Row 13 **x* Here, * indicates that the seat is available; X indicates that the seat has been assigned. Make this a menu-driven program; choices. Your program must use 2D array and the following methods: show the user's choices and allow the user to make the appropriate A method to initialize the seats A method to show the menu A method to assign a seat A method to show the seat assignments . . In addition, your program must validate all users' inputs such as wrong row or column number or if a seat is not available
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started