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)

C++  C++ 5. (20 points) Given the following class: class rectangleType public:

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!