Question: In this exercise, you modify the Terney Landscaping program from Lab 15-2 so that it passes an object to a function. a. If necessary, create

In this exercise, you modify the Terney Landscaping program from Lab 15-2 so that it passes an object to a function. 

a. If necessary, create a new project named Advanced19 Project and save it in the Cpp8\Chap15 folder. Copy the instructions from the Lab15-2.cpp file into a source file named Advanced19.cpp. Change the filename in the first comment. 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 Advanced19 Rectangle.h file. Change the filename in the first comment. 

b. Modify the program so that it uses a function named calcAndDisplay to calculate and display the area and the total price. Pass the Rectangle object and the price per square yard to the function. Save and then run the program. Test the program using 120 feet as the length, 75 feet as the width, and 1.55 as the price. The program should display 1000.00 as the area in square yards and $1550.00 as the total price.

Step by Step Solution

3.35 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

include using namespace std class Rectangle public void calcAndDisplayf... 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!