Define a Class in C++. (FLIGHT)

Define a class FLIGHT in C++ with the following specification:

Private members
  • ·         A Data Member FlightNumber of type integer
  • ·         A Data Member Destination of type string
  • ·         A Data Member Distance of float type
  • ·         A Data Fuel of type float
  • ·         A member Function CalFuel() to calculate the value of fuel as per the following criteria:

Distance
Fuel
<= 1000
500
more than 1000 and <= 2000
1100
more than 2000 
2200

Public members
  • ·         A function Feed_info() to allow user to enter values for Flight Number,Destination, Distance and Call Function CalFuel() to calculate the quantity of fuel.
  • ·         A function Show_Fuel() to allow user to view the content of all the data members.




No comments

Post your comments

Powered by Blogger.