answersLogoWhite

0

class Chicken {
public:
virtual

~Chicken( )

{ }


virtual void

call( ) = 0;

};

class Rooster : public Chicken {
void

call( )

{ cout << "cocka-doodle-doo" << endl; }

};

class Hen : public Chicken {
void

call( )

{ cout << "cluck cluck" << endl; }

};

class Chick : public Chicken {
void

call( )

{ cout << "peep peep" << end; }

};

User Avatar

Wiki User

15y ago

Still curious? Ask our experts.

Chat with our AI personalities

LaoLao
The path is yours to walk; I am only here to hold up a mirror.
Chat with Lao
FranFran
I've made my fair share of mistakes, and if I can help you avoid a few, I'd sure like to try.
Chat with Fran
BeauBeau
You're doing better than you think!
Chat with Beau

Add your answer:

Earn +20 pts
Q: Examples of inherited from a chicken?
Write your answer...
Submit
Still have questions?
magnify glass
imp