Consider the following class definition: class rectangleType { public: void setL
ID: 3547139 • Letter: C
Question
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;
};
Which of the following class variable declarations is correct?
rectangle rectangleType;
class rectangleType rectangle;
rectangleType rectangle;
rectangle rectangleType.area;
Explanation / Answer
rectangleType rectangle;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.