1. class rectangleType { public: //Postcondition: length = x; width = y; void se
ID: 3644217 • Letter: 1
Question
1. class rectangleType{
public:
//Postcondition: length = x; width = y;
void setLengthWidth(double x, double y);
//Output length and width;
void print() const;
//Calculate and return the area of the rectangle;
double area();
//Calculate and return the parameter;
double perimeter();
//Postcondition: length = 0; width = 0;
rectangleType();
//Postcondition: length = x; width = y;
rectangleType(double x, double y);
private:
double length;
double width;
};
// and the object declaration
rectangleType bigRect(14,10);
Which of the following statements is correct?
bigRect.setLengthWidth();
bigRect.setLengthWidth(3.0, 2.0);
bigRect.length = 2.0;
bigRect.length = bigRect.width;
When creating a macro, which preprocessor directive is used?
ifndef
define
ifdef
endif
Which is a correct preprocessor directive statement?
define PI = 3.141593
define PI = 3.141593;
#define PI 3.141593
#define PI = 3.141593
Which is a correct preprocessor directive statement?
define PI = 3.141593
define PI = 3.141593;
#define PI 3.141593
#define PI = 3.141593
Explanation / Answer
1.bigRect.setLengthWidth(3.0, 2.0); 2. define 3. define PI = 3.141593; 4. define PI = 3.141593;
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.