Question: In this exercise, you use the Rectangle class from Lab 15-2 to instantiate a Rectangle object in the All-Around Fence Company program. If necessary, create
In this exercise, you use the Rectangle class from Lab 15-2 to instantiate a Rectangle object in the All-Around Fence Company program. If necessary, create a new project named Intermediate14 Project. 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 Intermediate14 Rectangle.h. Change the filename in the first comment. The owner of All-Around Fence Company wants a program that calculates the cost of installing a fence. Use the IPO chart shown in Figure 15-22 to code the program. Enter your C++ instructions into a source file named Intermediate14.cpp. Display the perimeter as an integer. Display the total price with a dollar sign and two decimal places. Also enter appropriate comments and any additional instructions required by the compiler. Save and then run the program. Test the program using 120 as the length, 75 as the width, and 10 as the cost per linear foot. The program should display 390 linear feet as the perimeter and $3900.00 as the total price.

Input Length (in feet) width (in feet) fence cost (per Linear foot) Processing Processing items: Rectangle object Output perimeter total price Algorithm: 1. enter length, width, and fence cost 2. use the Rectangle object's setDinmensions method to assign the length and width to the Rectangle object; pass the method the length and width 3. use the Rectangle object's calcPerimeter method to calculate and return the perimeter 4. calculate the total price by multiplying the perimeter by the fence cost 5. display the perimeter and total price Figure 15-22
Step by Step Solution
3.37 Rating (166 Votes )
There are 3 Steps involved in it
include include using namespace std class Rectangle public float length width void SetDimen... View full answer
Get step-by-step solutions from verified subject matter experts
