163k views
4 votes
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, and the declaration: rectangleType bigRect; Which of the following statements is correct?

a) rectangleType::print();
b) rectangleType.print();
c) bigRect.print();
d) bigRect::print();

User Ondrobaco
by
6.3k points

1 Answer

0 votes

Answer:

c) bigRect.print();

Step-by-step explanation:

We have a class named rectangleType and an obejct is created as rectangleType bigRect; (We have an object named bigRect).

In order to use any function with this object, we need to write the object name, a dot, and the name of the function.

bigRect.print();

User Adolfo Garza
by
5.9k points