Skip to main content
MoodleDigitalScenarios
  • Home
  • More
English ‎(en)‎
English ‎(en)‎ Ελληνικά ‎(el)‎
You are currently using guest access
Log in
Home
  1. Κληρονομικότητα
  2. Γράψτε τον κώδικα της κλάσης προγόνου human. Βασιστείτε στις κλάσεις που δίνονται

Γράψτε τον κώδικα της κλάσης προγόνου human. Βασιστείτε στις κλάσεις που δίνονται

Completion requirements
class adult
{
private:
    int height;
    double weight;
    string profesion;
public:
    void print()
    {
        cout<<"Height="<<height<<" Weight="<<weight<<" Profesion="<<profesion<<endl;
    }
};
class child
{
private:
    int height;
    double weight;
    string school;
public:
    void print()
    {
        cout<<"Height="<<height<<" Weight="<<weight<<" School="<<school<<endl;
    }
};
class elder
{
private:
    int height;
    double weight;
    double pension;
public:
    void print()
    {
        cout<<"Height="<<height<<" Weight="<<weight<<" Pension="<<pension<<endl;
    }
};
You are currently using guest access (Log in)
Data retention summary
Powered by Moodle