Answered step by step
Verified Expert Solution
Link Copied!

Question

00
1 Approved Answer

QUESTION 2 : Implement a class Flight that represents an airplane flight as follows. The class should encapsulate information about the origin, destination, date of

QUESTION 2: Implement a class Flight that represents an airplane flight as follows.
The class should encapsulate information about the origin, destination, date of departure, date of arrival, and flight number. (the flight number should be ineremented automatically; the first flight has a number 1, the second 2, and so on. The flight number is fixed at all times and does not change.
The class should have only one constructor and no set methods.
The class should be able to print the standard output information about itself.
Test your class with a simple driver that defines two different flights and prints their details. Use separate implementations with different headers to store the class declaration.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access with AI-Powered 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

Students also viewed these Databases questions