Solved

Figure 2:
Class RectangleType
{
Public \quad Void SetLengthWidth(double X, Double Y);

Question 7

Multiple Choice

Figure 2:
class rectangleType
{
public:
\quad void setLengthWidth(double x, double y) ;
\quad\quad //Postcondition: length = x; width = y;
\quad void print() const;
\quad\quad //Output length and width;
\quad double area() ;
\quad\quad //Calculate and return the area of the rectangle;
\quad double perimeter() ;
\quad\quad //Calculate and return the parameter;
\quad\quad rectangleType() ;
\quad\quad //Postcondition: length = 0; width = 0;
\quad rectangleType(double x, double y) ;
\quad\quad //Postcondition: length = x; width = y;
private:
\quad double length;
\quad double width;
};
-Consider the accompanying class definition in Figure 2.Which of the following variable declarations is correct?


A) rectangle rectangleType;
B) class rectangleType rectangle;
C) rectangleType rectangle;
D) rectangle rectangleType.area;

Correct Answer:

verifed

Verified

Unlock this answer now
Get Access to more Verified Answers free of charge

Related Questions