This is C include include Painting Calculator You will write

This is C++
#include<stdio.h>
#include<math.h>

Painting Calculator You will write a program that will help you calculate how much time and paint it will require to paint a room. For the purposes of this program, assume you can paint four square feet in 1 minute and a quart of paint will cover one hundred square feet. Painting the edges is more time consuming as you have to be careful not to get paint on any wooden trim, so it takes 2 minutes to pain1 linear foot of trim Your program will prompt the user to enter the width and height of a wall, in feet. You can calculate the area of the wall to determine how many square feet you have to paint. That can be used to calculate the amount of paint and the time needed. The entire perimeter of the wall is considered \"trim\", so you\'ll need to add in the calculated time for the trim Assume no extra paint is needed for the trim. So, for example, if the user wants to paint a wall 10 feet tall and 20 feet wide, that is 200 square feet. Since 1 quart of paint covers 100 square feet, you will need 2 quarts. The trim to be painted, along the floor, the ceiling, and both ends of the wal, is a total of 60 feet (the perimeter of the rectangular )t will take you 120 minutes to paint the trim (2 minutes per foot) and since you can paint 4 square feet per minute, it takes 50 minutes to paint the wall, for a total of 170 minutes But things can get more complex. If there is a window in the w, then that represents an area you do not have to paint, but the perimeter of the window is considered to be trim Your program should ask the user how many windows are in the wall, then read in the width and height of each window. Subtract the area of the windows from the area of the wall to determine how many square feet to paint. Add the perimeter of the windows to the amount of trim to be painted Walls may also have doors. The are like windows in that doorways are not to be painted but the rules for trim are different. The bottom of a doorway is not painted, so that is less trim. Bu the top of the doorway is trim, so they cancel out The sides of the doorway are trim. So, similar to windows, your program should ask the user to enter the number of doors, then enter the width and height of each door. Update the area and trim to be painted After the user has entered all the data, you should print the number of quarts of paint that wil be needed, the number of minutes spent on painting the trim, and the total amount of time expected to complete all painting

Solution

#include <iostream>

#define PAINT_AMT 100
#define AREA_PER_MINUTE 4
using namespace std;

int main(){

float total_area=0,trim_length=0;
float height,width,window,door;
cout<<\"Enter width of room:\";
cin>>width;
cout<<\"Enter heigth of room:\";
cin>>height;
total_area= height*width;
trim_length = 2*(height+width);
cout<<\"Enter number of windows :\" ;

cin >> window;

for(int i=0;i<window;i++){
float w_wd,w_ht;
cout<<\"Enter width of window #\" << i+1 ;
cin>>w_wd;
cout<<\"Enter heigth of window #\" << i+1 ;
cin>>w_ht;
total_area -=w_wd*w_ht;
trim_length += 2*(w_wd+w_ht);
}
cout<<\"Enter number of doors :\" ;

cin >> door;
for(int i=0;i<door;i++){
float d_wd,d_ht;
cout<<\"Enter width of door #\" + i+1 ;
cin>>d_wd;
cout<<\"Enter heigth of door #\" + i+1 ;
cin>>d_ht;
total_area -=d_wd*d_ht;
trim_length += 2*(d_ht);
}
cout<< \"Perimeter: \"<<trim_length<<endl;
cout<< \"Area: \"<<total_area<<endl;
cout<< \"you will need approx \"<<total_area/100<<\" quarts paint\"<<endl;
cout<< \"you will need approx \"<<trim_length*2<<\" minutes to do trim work\"<<endl;
cout<< \"you will need approx \"<<(trim_length*2+total_area/4)<<\" minutes to do complete work\"<<endl;

return 0;
}

This is C++ #include<stdio.h> #include<math.h> Painting Calculator You will write a program that will help you calculate how much time and paint it
This is C++ #include<stdio.h> #include<math.h> Painting Calculator You will write a program that will help you calculate how much time and paint it

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site