Rectangle Area

  • + 0 comments

    include

    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;
    

    }