This is C include include Painting Calculator You will write
Solution
Dear Student,
Following c program demonstrate this.
The program is tested on Ubuntu 14.04 system.Compilation has been done using gcc compiler.
Program:
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<math.h>
int main()
{
float width,height,windows;
double area_win1,area_win2,area_door,A, perimeter_win1,perimeter_win2,perimeter_door,P;
float T1,T2,quarts;
float width_window1,width_window2, height_window1,height_window2;
int width_door, height_door,doors;
printf(\"Please enter the width of the room:\");
scanf(\"%f\",&width);
printf(\"Please enter the height of the room:\");
scanf(\"%f\",&height);
printf(\"Enter number of windows:\");
scanf(\"%f\",&windows);
printf(\"Enter width of window #1: \");
scanf(\"%f\",&width_window1);
printf(\"Enter height of window #1: \");
scanf(\"%f\",&height_window1);
printf(\"Enter width of window #2: \");
scanf(\"%f\",&width_window2);
printf(\"Enter height of window #2: \");
scanf(\"%f\",&height_window2);
printf(\"Enter number of doors:\");
scanf(\"%d\",&doors);
printf(\"Enter width of the door #1: \");
scanf(\"%d\",&width_door);
printf(\"Enter height of the door #1: \");
scanf(\"%d\",&height_door);
area_win1=width_window1*height_window2;
area_win2=width_window2*height_window2;
area_door=width_door*height_door;
A=width*height;
A=A-area_win1-area_win2-area_door;
quarts = A/100;
printf(\"Area: %0.2lf\ \",A);
perimeter_win1=2*width_window1+2*height_window2;
perimeter_win2=2*width_window2+2*height_window2;
perimeter_door=2*height_door;
P=2*width+2*height;
P=P+perimeter_win1+perimeter_win2+perimeter_door;
printf(\"Perimeter: %0.2lf\ \",P);
printf(\"You will need approximately %0.2f quarts of paint\ \",quarts);
T1=2*P;
printf(\"You will nedd approximately %0.2f minutes to do the trim work\ \",T1);
T2=T1+A/4;
printf(\"You will need approximately %0.2f minutes to paint the wall,\ \",T2);
}
Output:
Please enter the width of the room:13
Please enter the height of the room:9
Enter number of windows:2
Enter width of window #1: 4
Enter height of window #1: 5.5
Enter width of window #2: 4
Enter height of window #2: 5.5
Enter number of doors:1
Enter width of the door #1: 4
Enter height of the door #1: 7
Area: 45.00
Perimeter: 96.00
You will need approximately 0.45 quarts of paint
You will nedd approximately 192.00 minutes to do the trim work
You will need approximately 203.25 minutes to paint the wall,
####Dear Student if you are satisfied with the answer please provide your valuable#### feedback.

