Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Problem: A small airline has decided to create a new automated system for reservations. You have been hired to write the program for this
The Problem:
A small airline has decided to create a new automated system for reservations. You have been hired to write the program for this system. Customers will be allowed to book a reservation, cancel an existing reservation and request a seating chart. The airline has several planes, each with a different number of seats but all planes only have 1 seat per row. Due to COVID the airline is advertising that passengers in each class of service (first and coach) will be capped at 50% capacity and passengers will be assigned seats to ensure social distancing.
Specifications:
Seat Class:
An instance of the Seat class should store the type of seat (first or coach), whether the seat is empty or occupied, and the seat number. The Seat class should provide the following behaviors:
A parameterized constructor the constructor will accept values for the seat number and the type of seat and store this information appropriately. Initially, the seat should be marked as empty.
Accessor methods for the seat type, seat number and whether or not it is empty/occupied.
A method to reserve a seat.
A method to cancel a reservation.
A toString method which returns a string containing the seat number, type and whether
or not it is occupied.
Can you please help me with this class. It needs to be done in Java.
Thanks
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