Look at the following class definition: class rectangleType { public: void setLe
ID: 3528191 • Letter: L
Question
Look at the following class definition: class rectangleType { public: void setLengthWidth(double x, double y); //Postcondition: length = x; width = y; void print() const; //Output length and width; double area(); //Calculate and return the area of the rectangle; double perimeter(); //Calculate and return the parameter; rectangleType(); //Postcondition: length = 0; width = 0; rectangleType(double x, double y); //Postcondition: length = x; width = y; private: double length; double width; }; 1. Create an object named myRect with dimensions 3, 4 2. Call the print function on myRect 3. Display the area of myRectExplanation / Answer
#include #include class rectangleType { private: double length; double width; public: void setLengthWidth(double x, double y); { length=x; width=y; } void print() { coutRelated Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.