24.5 PERSONS
Large number of applications will require an object of type person.
class Person
{ private : string20 name; int age public: Person() ; Person( string name1, int age1); void init( string name1, int age1); void show(); } ;
class Player : public Person
{ Private : int runs; static string logo ; public: Player(); Player(string name1, int age1 ,int runs1 ); void init(string name1, int age1 ,int runs1 ); void show() ; }
class Student : public Person
{ private : int rollnum ; int marks; public: Student(); void init(string name1, int age1 ,int rn1 , int marks1 ); void show(); };
Basically class employee can be derived from class person. ...
Get Object Oriented Programming with C++, Second Edition now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.