Question: I wanted to see the final code would be with the 3 files after solving the questions. 2. Assume given the following class definition: class

I wanted to see the final code would be with the 3 files after solving the questions.

I wanted to see the final code would be with the 3files after solving the questions. 2. Assume given the following class definition:

2. Assume given the following class definition: class Rectangular Lot { public: RectangularLoto: 1/default length is 1 and default width is 1 Rectangular Lot( double len, double wid): void read0: // read the length and the width of the lot void setLength( double len); // set the new value of the data member length void setWidth( double wid); // set the new value of the data member width double getLength(): // returns the length of the lot double getWidth(); 1/returns the width of the lot double getArea); // computes and returns the area of the lot void printo: // prints the length, the width and the area of the lot private: double length; double width: }; 1. Write the definitions of the constructors and the other member functions of this class. 2. Write the definition of the derived class of class RectangularLot named Lot4Sale as follows: a. It has an additional private data member named unitPrice (double precision value). b. In addition to the constructors, it has the following public member functions: double getUnitPrice() returns the value of the data member unitPrice. void setUnitPrice( double uprice ) sets the new value of the unit price. double getPricel) returns the price of the lot (the unit price times the area). c. Member function void read() is redefined in class Lot4Sale. It reads the unit price in addition to the length, and the width. d. Member function void print() is redefined in class Lot 4Sale. It prints the unit price and the price of the lot (the unit price times the area) in addition to the length, the width, and the area. 3. Write the definitions of the constructors (the default unit price is $1000.00), the functions read() and print(), and the new member functions of the class Lot4Sale. 4. Assuming that objects lot1 and lot2 are defined as follows (in "main.cpp" file): RectangularLot lot1( 80.00, 55); Lot4Sale lot2( 120, 50, 5000.00); What is the output produced by the following two statements: lot1.print(); lot2.print(); You need to create 3 files, RectangularLot.h, RectangularLot.cpp, and main.cpp

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!