Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with this problem. Thank You! Please keep it as simple as possible, A room needs to be painted. The room has one door,

Need help with this problem. Thank You! Please keep it as simple as possible,

image text in transcribed

image text in transcribed

A room needs to be painted. The room has one door, two windows, and a built-in bookshelf. Only the walls of the room are to be painted. Write a program that prompts the user to input the width and heights of the door, each window, and the bookshelf (in inches) the length, width, and height of the room (in feet), and the area that can be painted with one gallon of paint (in square feet). The program outputs the minimum number of gallons of paint that must be purchased to paint the wall (excluding the window, of course!). Paint can only be purchased in 1 gallon containers. Include only the header. Input Specification All dimensions are non-negative. Door, window, and bookshelf dimensions are in inches. Room length, width, and height dimensions are in feet. The area that can be painted with one gallon of paint is in square feet. Output Specification Output the total area to paint, the number of gallons of paint required, and the minimum whole number of gallons of paint to buy. Use the formatting shown in the Sample Interaction below. Your program's output should terminate with one blank line. Sample Interaction $ clang++ -std=C++14 -Weverything pa02.cpp $ ./a.out This program computes gallons of paint required to paint a room. Enter DOOR width and height (in), separated by a space: 36 80 Enter WINDOW 1 width and height (in), separated by a space: 24 60 Enter WINDOW 2 width and height (in), separated by a space: 36 60 Enter BOOKSHELF width and height (in), separated by a space: 48 96 Enter ROOM width, length, and height (ft), separated by spaces: 13.85 14 10 Enter area covered by one gallon of paint (sq ft): 120 Total area to paint (sq ft): 480 Total paint required (gals): 4 Minimum paint to buy (gals): 4 $ ./a.out This program computes gallons of paint required to paint a room. Enter DOOR width and height (in), separated by a space: 36 80 Enter WINDOW 1 width and height (in), separated by a space: 24 60 Enter WINDOW 2 width and height (in), separated by a space: 36 60 Enter BOOKSHELF width and height (in), separated by a space: 48 96 Enter ROOM width, length, and height (ft), separated by spaces: 13.85 14 10 Enter area covered by one gallon of paint (sq ft): 110 Total area to paint (sq ft): 480 Total paint required (gals): 4.36364 Minimum paint to buy (gals): 5

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions