Classes and Objects Worksheet2
Classes and Objects Worksheet2
Methods:
Checkin()-a function to enter the content rno,name,tariff and NOD
Checkout(()- a function to display rno, name,tariff,NOD and amount
(amount to be displayed by calling function calcu())
500 >=1000
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
i.e. 3 * 300 + 2 * 150 = 1200
-A funtion EnterTravel( ) to input the values of the data members T_Code,
No_of_Adults, No_of_Children and Distance; and invoke the AssignFare() function.
-A function ShowTravel() which displays the content of all the data members for a
Travel.