Understanding Sequential Statements
In this exercise, you use what you have learned about sequential statements to read a scenario and then answer Questions. Suppose you have written a C++ program that calculates the amount of paint you need to cover the walls in your family room. Two walls are 9 feet high and 19.5 feet wide. The other two walls are 9 feet high and 20.0 feet wide. The salesperson at the home improvement store told you to buy 1 gallon of paint for every 150 square feet of wall you need to paint. Suppose you wrote the following code, but your program is not compiling. Take a few minutes to study this code, and then answer Questions.
// This program calculates the number of gallons of paint needed.#includeusing namespace std;int main(){double height1 = 9;double height2 = 9;int width1 = 19.5;double width2 = 20.0;double squareFeet;int numGallons;numGallons = squareFeet / 150;squareFeet = (width1 * height1 + width2 * height2) * 2;cout ≪ "Number of Gallons: " ≪ numGallons ≪ endl;return 0;}
You have two variables declared in this program to represent the height of your walls, height1 and height2. Do you need both of these variables? If not, how would you change the program? Be sure to identify all of the changes you would make.
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.