(c) Define a class CABS in C++ with the following specification: Data Members . CNo to No - store Cab - 'A', or'C' 'B' C Kilo to City Type PKM to Meter Type - character - per store store charges a as . KM) Dist - to Distance travelled (in store Member Functions . 'A' A initialize constructor function to Type CNo ' as and as ‘000 A function PKM following to per table: assign the as - A to for and Type. Also, function allow to RegisterQ administrator enter the values CNo to call this function Charges0 should assign PKM Charges. . A to allow to of function ShowCab0 user enter the value Distance display CNo, Type, and PKM, PKM*Distance Amount) on (as screen (iv): following the C++ the Consider code and from (i) to questions answer Class Campus { long Id; char City[20]; proteected: char Country l2O1 ; public : Campus() ; void Register() ; void Display() ; ); class Dept : private campus { Iong DCode [ 101 ; char HOD [20] ; protectsed : double Budgets ; public: Dept () ; void Enter() ; void Show() ; ); class Applicant: public Dept { long RegNo; char Name [20] ; public: Applicant () ; void Enroll () ; void View () ; Which type of Inheritance is shown in the above example ?
(c) Define a class CABS in C++ with the following specification: Data Members . CNo - to store Cab No - Type - to store a character 'A', 'B' or'C' as City Type C PKM - to store per Kilo Meter charges . Dist - to store Distance travelled (in KM) Member Functions . A constructor function to initialize Type as 'A' and CNo as ‘000 ' A function to assign PKM as per the following table: - A function RegisterQ to allow administrator to enter the values for CNo and Type. Also, this function should call Charges0 to assign PKM Charges. . A function ShowCab0 to allow user to enter the value of Distance and display CNo, Type, PKM, PKM*Distance (as Amount) on screen Consider the following C++ code and answer the questions from (i) to (iv): Class Campus { long Id; char City[20]; proteected: char Country l2O1 ; public : Campus() ; void Register() ; void Display() ; ); class Dept : private campus { Iong DCode [ 101 ; char HOD [20] ; protectsed : double Budgets ; public: Dept () ; void Enter() ; void Show() ; ); class Applicant: public Dept { long RegNo; char Name [20] ; public: Applicant () ; void Enroll () ; void View () ; Which type of Inheritance is shown in the above example ?
233885293cs_xii_holidays_assignment2017.docx