Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

32.Consider the following class definition. [16 points) class rectangleType public: y void setlengthWidth(double x, double y): I/ Postcondition: lengthx;width void print() const; double areal) double

image text in transcribed
32.Consider the following class definition. [16 points) class rectangleType public: y void setlengthWidth(double x, double y): I/ Postcondition: lengthx;width void print() const; double areal) double perimeter(): rectangleType() rectangleTypeldouble x, double yl: // Output length and width; // Calculate and return the area of the rectangle; I/ Calculate and return the parameter // Postcondition: length 0; width 0; // Postcondition: length x; width y private: double length; double width; Which of the following variable declarations is correct? [2 points) a. rectangle rectangleType; b. class rectangleType rectangle; c. rectangleType rectangle; d. rectangle rectangleType(20); 1) 2) Consider the following declaration: rectangleType bigRect; Which of the following statements is correct? 12 points] a rectangleType.print(): b. rectangleType:print(0: c. bigRect.print d. bigRect: print): Consider the following object declaration: 3) rectangleType bigRect(14,10) Which of the following statements is correct? [2 points] a. bigRect.setlengthWidth(l: b. bigRect.setLengthWidth(3.0, 2.0) c. bigRect.length 2.0; d. bigRect.length bigRect.width 4) Which member function is a mutator? [2 points] Write a declaration statement and output statement to calculate and print the area and perimeter of a rectangle with width 12.5 and length 6.5. (They can be more than two statements.) [4 points) rectangleType 5) 6) Write the implementation of the member function area. [4 points double

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Excel As Your Database

Authors: Paul Cornell

1st Edition

1590597516, 978-1590597514

More Books

Students also viewed these Databases questions

Question

5. If yes, then why?

Answered: 1 week ago

Question

6. How would you design your ideal position?

Answered: 1 week ago