From 775172a8bc1229379f88e71e333a652672f00f74 Mon Sep 17 00:00:00 2001 From: Archit Khode Date: Wed, 6 Jun 2018 18:05:15 -0700 Subject: [PATCH] Updated for the newer version of the problem --- C++/rectangle-area.cpp | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) diff --git a/C++/rectangle-area.cpp b/C++/rectangle-area.cpp index ea1af03..cc7ae00 100644 --- a/C++/rectangle-area.cpp +++ b/C++/rectangle-area.cpp @@ -6,45 +6,35 @@ #include #include #include + using namespace std; class Rectangle { -private: +protected: int width; int height; public: - /* - Rectangle(int w, int h) { - width = w; - height = h; - } - */ int size() { return width * height; } - void Display() { + void display() { cout << width << " " << height << endl; } }; class RectangleArea : public Rectangle { -private: - int width; - int height; - public: - //RectangleArea(int w, int h); - void Input() { + void read_input() { cin >> width; cin >> height; } - void Display() { + void display() { cout << width * height << endl; } };