Program requirements:
We were given a program to write outside of class for extra. I am stuck though..Code:* Your program should prompt the user to enter the length of the room to be painted. * Your program should prompt the user to enter the width of the room to be painted. * Your program should prompt the user to enter the height of the room to be painted. * Your program should prompt the user to enter the total square footage of windows in the room. After all, you wouldn't expect to paint the windows themselves. * Your program should calculate the number of gallons needed to paint the room. Assume that one gallon of paint will cover 200 square feet of wall. * Your program should print a message indicating how many gallons of paint will be needed to paint the room.
This is what I have, not sure where to go though...
Any help? This is my first programming class to take, so it is a bit foreign to me..Code:#include <stdio.h> main() { Paint values = 1 gallon of paint covers 200 square/feet. printf("input room dimensions\n"); printf("length? "); scanf("%f", &length); printf("width? "); scanf("%f", &width); printf("height ?"); scanf("%f", &height"); printf("input total square/feet of windows in room\n"); printf("sqaure_feet? "); scanf("%f", &square_feet); wall_area = 2*height*(length+width)-(window_area + door_area); gallons = (wall_area/window_area) + 0.999 ; printf("number of gallons needed to paint room = %d\n", gallons); }



LinkBack URL
About LinkBacks




