Question: C++ 5. (20 points) Given the following class: class rectangleType public: void setLengthWidth (double x, double y)i //sets the length = x; width void print)
5. (20 points) Given the following class: class rectangleType public: void setLengthWidth (double x, double y)i //sets the length = x; width void print) const; y; //Output length and width double area ); //Calculate and return the area of the rectangle //(length*width) double perimeter ); //Calculate and return the perimeter (length of outside / /boundary of the rectangle) private: double length; double width; a) Assume that the following are done in main (5pts Each): I. Declare an instance of rectangleType. II. Set the length of the rectangle to 24 and the width to 30. III. Print out the area of the rectangle. b) Write the function definition for the funetion perimeter (10pts)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
