Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write a class called Flight that represents an airline flight. It should contain instance data that represents the airline name, flight number, and the flights

Write a class called Flight that represents an airline flight. It should contain instance data that represents the airline name, flight number, and the flights origin and destination cities. Define the Flight constructor to accept and initialize all instance data. Include getter and setter methods for all instance data. Include a toString method that returns a one-line description of the flight. Create a driver class call PP4_8 , whose main method instantiates and updates several Flight objects.

-After completing this assignment you should have two files PP4_8.java and Flight.java

-You should have a total of 10 methods when you have created the Flight class

1) One constructor method

2) Four setter methods- one for each piece of flight data

3) Four getter methods- one for each piece of flight data

4) One toString method

-The assignment states that you should instantiate (create) and updates several objects. I want you to specifically:

1) Create 7 flight objects.

2) Update the flight number on 2 of the flights after the objects have been created using a setter method that you created.

3) Update the airline name on 1 other flight object

4) Using a System.out.println method in PP4_8, print information about the three objects that you updated

5) Using getter methods, retrieve the flight number and destination of one of the non-modified flights and report to the user via a println statement that it has been delayed. Since this will not call the toString method, you should add an appropriate description with the data.

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 Administrator Limited Edition

Authors: Martif Way

1st Edition

B0CGG89N8Z

Students also viewed these Databases questions

Question

Azure Analytics is a suite made up of which three tools?

Answered: 1 week ago

Question

What is Change Control and how does it operate?

Answered: 1 week ago

Question

How do Data Requirements relate to Functional Requirements?

Answered: 1 week ago