00:01
Hello student, in this c+ + code, the flight class has the private data member for flight number, destination, distance, and fuel.
00:09
The calculatefuel function calculates the fuel based on the distance using the specified criteria.
00:15
The feedinfo function allows the user to input flight information and calculate the fuel using the calculatefuel function.
00:23
The showinfo function displays the flight information including fuel.
00:27
So in the main function, an instance of the flight class is created and the user is prompted to enter the flight information.
00:36
The calculated fuel and the flight information are then displayed.
00:39
So here the c+ + class definition for the flight class with specified public and private data members and private members and data.
00:50
So here includeiostream, includestring.
00:53
So here class flight has been made.
00:55
Here private data are flight number, string destination, float distance, and float fuel.
01:03
These are four information are private.
01:05
And void calculatefuel, this is a function.
01:08
It will calculate the fuel price.
01:12
So if distance is less than or equal to 1000, then 500 .0f.
01:17
So here else if distance is in between this, then if distance is greater than 100 and less than 2000, then fuel is 1000 else fuel is 200 .f.
01:30
So this will be the fuel cost and with the help of calculatefuel we will calculate.
01:35
And now after this function to feedinfo and calculatefuel.
01:42
So here feed information we will feed some information with the help of this void feedinfo.
01:49
And this is the public type here enter flight number.
01:54
So standard with the help of standard out with the help of standard in flight number.
01:59
We will enter with the help of scene .ignore clear the new line character from the buffer...