SPECIFIC DIRECTIONS

The cabin specifics: it’s still a simple rectangular structure, but now you’re only concerned with the walls—we’ll just forget about the ceiling for the rest of our planning exercises. You’ll still need to request the users name, length of the room, its width, and its ceiling height (all in feet), the color of paint, (note the paint name can contain spaces) and the number of coats of paint to be applied in this order.

We need to know what the total wall surface area is so we can now determine how many windows are allowed; and finally we want to know how much paint will be needed. (We'll forget about the brushes also.)

Once you determine the total wall surface area, calculate the number of windows this way. We can install a maximum number of windows that are allowed by the county code for this area. That code states that the builder can install a maximum of one window for every 145 square feet of total wall surface area. (Don’t worry about corners, etc: just use the total wall area you came up with. So, for example, if the total wall surface area is 160,
then only one window is allowed. If the total area is 290, then two windows are allowed. You must quote a whole number of windows, not a fraction: we cannot install a fraction of a window! (See the appendix to these instructions for help.)

Plan on installing as many windows as possible. The windows will be a “standard” size, each one taking up 18 square feet of wall surface area. Once you determine the actual wall area that’s left to be painted—we certainly don’t want to paint the windows—calculate the final paint requirements as in Program #2: 1 gallon covers 350 square feet. (Hint #1: be careful about computing the wall area left after “carving” out the windows: there’s a trap that you need to avoid. Again, you must plan to install a whole number of windows.) (Hint #2: don’t forget to plan for how many coats of paint the user wants to apply!)

I attempted this and it didn't give me the results I was looking for.

To calculate the total wall surface area of the cabin, you need to gather the length, width, and ceiling height of the room. These measurements should all be in feet.

1. Ask the user for the length of the room in feet.
2. Ask the user for the width of the room in feet.
3. Ask the user for the ceiling height of the room in feet.

Once you have these measurements, you can calculate the total wall surface area by multiplying the length by the sum of the width and twice the ceiling height.

Total Wall Surface Area = Length * (Width + 2*Ceiling Height)

Next, you need to determine the number of windows allowed based on the total wall surface area. According to the county code, you can install one window for every 145 square feet of wall surface area. To calculate the number of windows allowed, divide the total wall surface area by 145 and round down to the nearest whole number.

Number of Windows Allowed = Total Wall Surface Area / 145 (rounded down to the nearest whole number)

Assuming you want to install as many windows as possible, each window occupies 18 square feet of wall space. To calculate the actual wall area that needs to be painted, subtract the product of the number of windows allowed and 18 from the total wall surface area.

Actual Wall Area to be Painted = Total Wall Surface Area - (Number of Windows Allowed * 18)

Lastly, calculate the amount of paint needed. Assuming each gallon of paint covers 350 square feet, divide the actual wall area to be painted by 350 and round up to the nearest whole number to account for the number of coats of paint.

Amount of Paint Needed (in gallons) = Actual Wall Area to be Painted / 350 (rounded up to the nearest whole number)

By following these steps, you should be able to determine the total wall surface area, the number of windows allowed, and how much paint will be needed for the cabin. Make sure to take note of the rounding and ceiling height considerations mentioned in the instructions.