/* Painting Project (15 points) Write a complete C program that can help you calculate how much paint you need in order to paint a room. The program must do the following: * Ask the user to enter - the length (L), width (W), and height (H) of the room. - the number of doors that the room has. - the width and height of the door(s). * Print the area of the paintable surface (all 4 walls plus the ceiling minus the doors). * Print the gallons of paint required to paint the room * Print the number of 5 gallon buckets of paint that you must purchase Assumptions: * the room has no windows; just doors of equal size. * 1 gallon of paint can cover 20 square feet of wall area */ #include #include #include #define SQFT_PER_GALLON 20 int main() { float L, W, H; float dw, dh; int nDoors; printf("Enter room Length (in ft): "); scanf("%f", &L); printf("Enter room Width (in ft): "); scanf("%f", &W); printf("Enter room Height (in ft): "); scanf("%f", &H); printf("Enter number of doors: "); scanf("%d", &nDoors); printf("Enter door width (in ft): "); scanf("%d", &dw); printf("Enter door height (in ft): "); scanf("%d", &dh); float doorArea = dw*dh; float ceiling_area = W*L; float wall_area = 2*W*H + 2*L*H; float paintable_area = wall_area + ceiling_area - doorArea*nDoors; printf("The paintable surface area is %g (ft^2)\n\n", paintable_area); float gallons = paintable_area / SQFT_PER_GALLON; int nBuckets = ceil(gallons/5.0); printf("This would require %g gallons to paint.\n", gallons); printf("You must purchase %d buckets of paint (5 gallons each).\n\n", nBuckets); system("pause"); }