24.10 RAIL TICKET
class Ticket { private : int key; int tclass; //class is reserved word int amount; string10 org; string10 dest; string27 name]; char ch ; public: void show(); int getAmount(); };
class PlainTicket
{ private: Date d1; int fare; int class; string sStation; //stating station public: void printMe() ; //show() }
class SimpleTicket: public PlainTicket
{ private: string dStation; //destination station public: void printMe() ; //overloaded }
class PaxInfo // passenger information
{ private string name; int age ; int sex ; }
In the text, class ReservedTicket was developed as an example of ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access