Computer Science, asked by babin164, 1 year ago


Define a class Travel in C++ with the description given below:

Private Members:
T_Code of type string
No_of_Adults of type integer
No_of_Children of type integer
Distance of type integer
TotalFare of type float

Public Members:
• A constructor to assign initial values as follows:
T_Code with the word "NULL"
No_of_Adults as 0
No_of_Children as 0
Distance as 0
TotalFare as 0
• A function AssignFare( which calculates and assigns the value
of the data member TotalFare as follows:
For each Adult
Fare (Rs) For Distance (Km)
500 >=1000
300 <1000 & >=500
200 <500
For each Child the above Fare will be 50% of the Fare mentioned in
the above table.
For example:
If Distance is 750, No_of_Adults=3 and No_of_Children = 2
Then TotalFare should be calculated as
No of Adults * 300 + No of Children * 150
ie3. 300+2 * 150 = 1200
A function Enter Travek) to input the values of the data members
T Code, No_of_Adults, No_of_Children and Distances and
invoke the AssignFare() function.
• A function ShowTravek) which displays the content of all the
data members for a Travel​

Answers

Answered by Anonymous
2

Answer:

All 26 Letters. What is the name for a sentence that contains All 26 Letters of the alphabet? These things are called pangrams and the most famous is the one typists use to test their keyboards: The quick brown fox jumps over the lazy dog.

Similar questions