1. ## Beginner stumped..

Program requirements:

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.```
We were given a program to write outside of class for extra. I am stuck though..

This is what I have, not sure where to go though...

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);

}```
Any help? This is my first programming class to take, so it is a bit foreign to me..

2. Originally Posted by kiorei
Program requirements:

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.```
We were given a program to write outside of class for extra. I am stuck though..

This is what I have, not sure where to go though...

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);

}```
Any help? This is my first programming class to take, so it is a bit foreign to me..
First make your main return int:

Code:
```int main()
{
code here

return 0;

}```

Second, you are using float variables (length, height, etc.) without any
declarations. I'm assuming you know how to do that.

Edit:
Code:
`Paint values = 1 gallon of paint covers 200 square/feet.`
<--- what is that supposed to do?

Edit#2:

:Paint values = 1 gallon of paint covers 200 square/feet.
With the statement above, I've come to the conclusion that you probably don't know how to declare variables yet. Check out the link below.

http://en.wikipedia.org/wiki/C_varia...d_declarations

3. Ah. you are right. I am trying to follow along with the book Through C to C++: a complete programming course with what I am doing. Doesn't look like that is helping too much it seems.

Edit.

Ok, I think this is better. It looks closer to what the book is using..

Code:
```#include <stdio.h>

void main(void)
{
const	float	paint_cover = 200.0;

float	length, width, height;
float	wall_area;
int	gallons;

printf("input room dimension\n");
printf("length? ");
scanf("%f", &length);
printf("width? ");
scanf("%f", &width);
printf("height? ");
scanf("%f", &height);

wall_area = 2*height*(length + width)- (window_area)
gallons = (wall_area / paint_cover) + 0.999;

printf("number of gallons needed to paint room = %d\n", gallons);

}```
The question I have is how do I declare window_area a unknown, as it is left up to the user...

or is this completely wrong...