Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Rectangle
- {
- public:
- void Display()
- {
- cout << width << ' ' << height << '\n';
- }
- protected:
- unsigned int width;
- unsigned int height;
- };
- class RectangleArea: public Rectangle
- {
- public:
- void Input()
- {
- cin >> width >> height;
- }
- void Display()
- {
- cout << width * height << '\n';
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement