Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

in java, this is not an application class please do not include anything from application class Airplane Class: An instance of the Airplane class should

image text in transcribed
in java, this is not an application class please do not include anything from application class
Airplane Class: An instance of the Airplane class should store a reference to an array which stores references to seats on the plane and the number of seats in first class. The Airplane class should provide the following behaviors: A parameterized constructor that creates the array based upon the number of seats passed to it as well as the actual seats. All planes have a maximum of 40% of their seats Page 1 of 5 . designated as first class and the remaining 60% as coach class. For example, in a plane with 10 seats, there are 4 first class seats (at the front of the plane) and 6 coach class seats (after the end of the first class). If there isn't an even split, the plane will have slightly less than 40% first class and slightly more than 60% coach class. For example, in a plane with 14 seats, 40% would be 5.6 seats. In order to avoid going over the 40% maximum, this plane would have 5 first class seats and 9 coach class seats. A method to determine and return the current capacity (ie the percent of occupied seats) of a class of seat (first or coach), A method to assign a first class or coach class seat. As long as the class of seat requested is less than 50% capacity, the reservation can be completed. Since the airline wants to keeps its passengers as socially distant as possible you will have to come up with a strategy to assign seats in such a way that passengers are spaced out within their class of service. Each row in the plane only has 1 seat. A method to cancel a specific previously reserved first class or coach class seat. A toString method which returns a string containing the state of the Airplane

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Management An Organizational Perspective

Authors: Richard T. Watson

1st Edition

0471305340, 978-0471305347

More Books

Students also viewed these Databases questions