You are viewing a single comment's thread. Return to all comments →
using namespace std;
class Rectangle{
public: int field_width; int field_height;
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(){
RectangleArea obj1; obj1.read_input(); int value = obj1.sum(); obj1.display(); cout<<value<<endl; return 0;
}
Seems like cookies are disabled on this browser, please enable them to open this website
Rectangle Area
You are viewing a single comment's thread. Return to all comments →
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(){
}