Question: In this exercise, you modify the Rectangle class from Lab 15-2 so that it allows a program to view the contents of the length and

In this exercise, you modify the Rectangle class from Lab 15-2 so that it allows a program to view the contents of the length and width data members. You also modify the Terney Landscaping program so that it displays the length and width measurements. 

a. If necessary, create a new project named Intermediate15 Project and save it in the Cpp8\Chap15 folder. Copy the instructions from the Lab15-2.cpp file into a source file named Intermediate15.cpp. Change the filename in the first comment. 

b. Copy the instructions from the Lab15-2 Rectangle.h file (which is located in either the Cpp8\Chap15\Lab15-2 Project folder or the Cpp8\Chap15 folder) into a header file named Intermediate15 Rectangle.h file. Change the filename in the first comment. 

c. Add two value-returning methods to the Rectangle class. Each method should return the value of one of the private variables. 

d. Modify the Terney Landscaping program so that it uses the methods to display the length and width of the Rectangle object. (The program should also display the area and total price.) Test the program appropriately

Step by Step Solution

3.28 Rating (169 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

declaration and implementation file of Rectangle Rectangleh class Rectangle private double length do... View full answer

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 Microsoft Visual C# Introduction Questions!