Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

9.Consider the following class definition. class rectangleType { public: void se

ID: 3645592 • Letter: 9

Question

9.Consider 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;
};

And consider this declaration.

rectangleType bigRect;

Which of the following statements is correct?
rectangleType.print();
rectangleType::print();
bigRect.print();
bigRect::print();

10. A class object can be ____; that is, it can be created once when the control reaches its declaration, and it can be destroyed when the program terminates.
static
automatic
local
public

Explanation / Answer

The following statement is correct

bigRect.print();

10. Automatic