In this exercise, you modify the Terney Landscaping program from Lab 15-2 so that it passes an
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 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 Answer:
Microsoft Visual C# An Introduction to Object-Oriented Programming
ISBN: 978-1337102100
7th edition
Authors: Joyce Farrell