The Total solution for NCERT class 6-12
Define a classTourist in C + + with the following specification:Data Members• CNo – to store Cab No• CType – to store a character ‘A’, ‘B’, or ‘C’ as City Type• PerKM – to store per Kilo Meter charges• Distance – to store Distance travelled (in KM) Member Functions• A constructor function to initialize CType as ‘A’ and CNo as ‘0000’• A function CityCharges() to assign PerKM as per the following table:
CType
PerKM
A
20
B
18
C
15
• A functionRegisterCab() to allow administrator to enter the values for CNo and CType.Also, this function should call CityCharges() to assign PerKM charges.• A function Display() to allow user to enter the value of Distance and displayCNo, CType, PerKM, PerKM*Distance (as Amount) on screen.