Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class People
- {
- private:
- int health;
- int age;
- public:
- People()
- {
- health = 1;
- age = 1;
- }
- People(int h,int a)
- {
- health = h;
- age = a;
- }
- void GetHealth()
- {
- qDebug() <<health;
- }
- void GetAge()
- {
- qDebug() <<age;
- }
- void SetHAA(int h,int a)
- {
- health = h;
- age = a;
- }
- virtual void information()
- {
- qDebug()<<"I usually people. i have health ="<< health <<"and my age = "<< age ;
- }
- };
- class Mage : public People
- {
- private:
- int mana;
- public:
- Mage(int h,int a,int m)
- {
- SetHAA(h,a);
- mana = m;
- }
- void information()
- {
- qDebug()<<"Im super mage i have health =";
- GetHealth();
- qDebug()<<"and my age = ";
- GetAge() ;
- }
- void spell();
- };
- class Tank: public People
- {
- private:
- int armor;
- public:
- void information()
- {
- qDebug()<<"I powerfull tank i have health =";
- GetHealth();
- qDebug()<<"and my age = ";
- GetAge() ;
- }
- void shield();
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement