[Cpp]
# Include <iostream>
Using namespace std;
Enum BREED {black, red, white, blue };
Class mam {
Public:
Mam (): age (4), weight (5 ){};
~ Mam (){}
Int get_age () const {return age ;}
Void set_age (int age1) {age = age1 ;}
Int get_weight () const {return weight ;}
Void set_weight (int x) {weight = x ;}
Void speak () const {cout <"mam sound! \ N ";}
Void sleep () const {cout <"I 'am sleeping. \ n ";}
Protected:
Int age;
Int weight;
};
Class dog: public mam {
Public:
Dog (): its_breed (red ){}
~ Dog (){}
BREED get_breed () const {return its_breed ;}
Void set_breed (BREED breed) {its_breed = breed ;}
Void wag_tail () const {cout <"Tail wagging... \ n ";}
Void beg_for_food () const {cout <"begging for food... \ n ";}
Private:
BREED its_breed;
};
Int main ()
{
Dog fido;
Fido. speak ();
Fido. wag_tail ();
Cout <"fido is" <fido. get_age () <"years old" <endl;
Cout <fido. get_breed () <endl;
Fido. set_breed (white );
Cout <fido. get_breed () <endl;
Return 0;
}