{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

peg - Sheet1 Page 1#include<iostream> using namespace...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Sheet1 Page 1 #include <iostream> using namespace std typedef int HANDS enum COLOR { Red, Green, Blue, Yellow, White, Black, Brown } class Animal // common base to both horse and bird { public: Animal(int) virtual ~Animal() { cout << "Animal destructor...\n" } virtual int GetAge() const { return itsAge } virtual void SetAge(int age) { itsAge = age } private: int itsAge } Animal::Animal(int age): itsAge(age) { cout << "Animal constructor...\n" } class Horse : virtual public Animal { public: Horse(COLOR color, HANDS height, int age) virtual ~Horse() { cout << "Horse destructor...\n" } virtual void Whinny()const { cout << "Whinny!... " } virtual HANDS GetHeight() const { return itsHeight } virtual COLOR GetColor() const { return itsColor } protected: HANDS itsHeight COLOR itsColor } Horse::Horse(COLOR color, HANDS height, int age): Animal(age), itsColor(color),itsHeight(height) { cout << "Horse constructor...\n" } class Bird : virtual public Animal { public: Bird(COLOR color, bool migrates, int age)...
View Full Document

{[ snackBarMessage ]}

Page1 / 2

peg - Sheet1 Page 1#include<iostream> using namespace...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online