We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
- Prepare
- C++
- Inheritance
- Rectangle Area
- Discussions
Rectangle Area
Rectangle Area
Sort by
recency
|
196 Discussions
|
Please Login in order to post a comment
include
using namespace std;
class Rectangle{
void display(){ cout< class RectangleArea : public Rectangle{ public: void read_input(){ cin>>field_width; cin>>field_height; } int sum(){ return field_width * field_height; }
};
int main(){
}
using namespace std;
class Rectangle { public: int width; int height; virtual void display() { cout << width << " " << height << endl; } }; class RectangleArea : public Rectangle { public: void read_input() { cin >> width; cin >> height;
};
int main() { RectangleArea rectangle1; rectangle1.read_input(); rectangle1.display(); return 0; }
C++ 14