Question: In this exercise, you modify the patio area program shown in Figure 15-7 in the chapter. If necessary, create a new project named ModifyThis11 Project
In this exercise, you modify the patio area program shown in Figure 15-7 in the chapter. If necessary, create a new project named ModifyThis11 Project and save it in the Cpp8\Chap15 folder. Enter the C++ instructions from the figure into a source file named ModifyThis11.cpp. Change the filename in the first comment. Enter the instructions shown in Figure 15-11 in the chapter in a header file named ModifyThis11 Square.h. Change the filename in the first comment. Modify the patio area program so it uses the parameterized calcArea method. Test the program appropriately.

1 //Modified Patio Area.cpp 2 //Displays the area of a square patio 3 //Created/revised by on 4 5 #include 6 #include "Square.h" 7 using namespace std; 8 9 int main() 10 { //instantiate a Square object Square patio; //declare variables double sideMeasurement = 0.0; double area = 0.0; 11 12 13 14 15 16 //get side measurement cout > sideMeasurement; //assign side measurement to Square object patio.setSide(sideMeasurement); 17 18 19 20 21 22 //calculate and display area patio.calcArea); 23 24 area = 25 cout < < "The area of a square patio
Step by Step Solution
3.40 Rating (153 Votes )
There are 3 Steps involved in it
Modified Patio Areacpp Displays the area of a square patio ... View full answer
Get step-by-step solutions from verified subject matter experts
