Question: Lab 6: Redesign the Rectangle class with private data members. Since data members are private, in order to access width and height in main program,
Lab 6: Redesign the Rectangle class with private data members. Since data members are private, in order to access width and height in main program, Rectangle class must provide public member methods, as getWidth(), getHeight(), setWidth), setHeight(), and getArea(). Then create a Rectangle object with default constructor, and later use above set and get methods to adjust width and height, and display the new width, height, and area information on screen. Homework 6: Design a class Point with two private data members x and y. Add constructors and get/set methods to Point class. Then collect x and y coordinates from keyboard to create a Point object, and display the coordinate values of this Point object
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
