Question: 32.Consider the following class definition. [16 points) class rectangleType public: y void setlengthWidth(double x, double y): I/ Postcondition: lengthx;width void print() const; double areal) double
32.Consider the following class definition. [16 points) class rectangleType public: y void setlengthWidth(double x, double y): I/ Postcondition: lengthx;width void print() const; double areal) double perimeter(): rectangleType() rectangleTypeldouble x, double yl: // Output length and width; // Calculate and return the area of the rectangle; I/ Calculate and return the parameter // Postcondition: length 0; width 0; // Postcondition: length x; width y private: double length; double width; Which of the following variable declarations is correct? [2 points) a. rectangle rectangleType; b. class rectangleType rectangle; c. rectangleType rectangle; d. rectangle rectangleType(20); 1) 2) Consider the following declaration: rectangleType bigRect; Which of the following statements is correct? 12 points] a rectangleType.print(): b. rectangleType:print(0: c. bigRect.print d. bigRect: print): Consider the following object declaration: 3) rectangleType bigRect(14,10) Which of the following statements is correct? [2 points] a. bigRect.setlengthWidth(l: b. bigRect.setLengthWidth(3.0, 2.0) c. bigRect.length 2.0; d. bigRect.length bigRect.width 4) Which member function is a mutator? [2 points] Write a declaration statement and output statement to calculate and print the area and perimeter of a rectangle with width 12.5 and length 6.5. (They can be more than two statements.) [4 points) rectangleType 5) 6) Write the implementation of the member function area. [4 points double
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
