Multiple Choice
Figure 2:
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;
};
-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:

Verified
Correct Answer:
Verified
Q1: If an object is declared in the
Q4: A C++ implementation file has the extension
Q5: A(n)_ statement is required by any program
Q8: Given the declaration<br>class myClass<br>{<br>public:<br>void print(); //Output the
Q11: The header file is also known as
Q12: In C++ terminology, a class object is
Q12: Classes were specifically designed in C++ to
Q21: In C++, the scope resolution operator is
Q28: Non-static member variables of a class are
Q31: If an object is created in a