Answer:
#include<iostream>
using namespace std;
//main function
int main(){
//initialization
float wallHeight, wallWidth;
int temp = 350;
//print the message
cout<<"Enter wall height (feet): ";
cin>>wallHeight; //read the input
cout<<"Enter wall width (feet): ";
cin>>wallWidth; //read the input
float wallArea = wallHeight * wallWidth; //calculate the wall area
cout<<"Wall area: "<<wallArea<<" square feet"<<endl; //display
float paintRequired = wallArea/temp; //calculate the paint needed
cout<<"The amount of paint in gallons needed: "<<paintRequired<<" gallons"<<endl;
return 0;
}
Explanation:
Include the library iostream for using the input/output instructions.
Create the main function and declare the variables.
Then, display the message on the screen and after that, read the input enter by user and store in the variables wallHeight .
similar, the process happens for the variable wallWidth.
then, calculate the area by using the formula.
[tex]area = height*width[/tex]
and store in the variable wallArea and then, display on the screen.
after that, calculate the paint required to paint the wall in gallon by using the formula.
given that, 1 gallon covers 350 area.
so, the formula is:
[tex]paint needed = \frac{wall area}{350}[/tex]
and store in the variable paintRequired. Then, display on the screen.