I am struggling with understanding how to code the calculations for these test cases. Math has not always been my strong suit but I am determined to learn the best way I can. Any guidance would be very much appreciated. Programming Language: C++ I need to first calculate the area of the four walls the user will need. Then I need to subtract the door and window area. Then I am supposed to add in the ceiling area to be painted. My calculations need to show the total square footage to be painted, and percent that is excluded for the doors and windows, and area of ceiling to be painted. Lastly, I need to show the user the total gallons calculated and round that number up to the number of gallon cans of paint needed. This is the 1st test case I need to test within my code: Room is 14 ft long and 12 ft 8 in wide and 8 ft high. Coverage is 250 ft2/gallon. Percent not painted = 15, ceiling is not painted. 2nd test case for testing with the code: Room is 25 ft 6 in long and 23 ft 9 in wide and 10 feet high. Coverage is 200 ft2/gallon, Percent not painted = 12, ceiling is painted.
I am struggling with understanding how to code the calculations for these test cases. Math has not always been my strong suit but I am determined to learn the best way I can. Any guidance would be very much appreciated.
I need to first calculate the area of the four walls the user will need. Then I need to subtract the door and window area. Then I am supposed to add in the ceiling area to be painted.
My calculations need to show the total square footage to be painted, and percent that is excluded for the doors and windows, and area of ceiling to be painted. Lastly, I need to show the user the total gallons calculated and round that number up to the number of gallon cans of paint needed.
This is the 1st test case I need to test within my code:
Room is 14 ft long and 12 ft 8 in wide and 8 ft high. Coverage is 250 ft2/gallon.
Percent not painted = 15, ceiling is not painted.
2nd test case for testing with the code:
Room is 25 ft 6 in long and 23 ft 9 in wide and 10 feet high.
Coverage is 200 ft2/gallon, Percent not painted = 12, ceiling is painted.
Step by step
Solved in 4 steps with 4 images