A room has one door, two windows, and a built-in bookshelf and it needs to be painted. Suppose that one gallon of paint can paint 120 square feet. Write a program that prompts the user to input (in feet): The length and width of the door The length and width of each window The length and width of the bookshelf The length, width, and height of the room The area that can be painted with one gallon of paint The program outputs: The amount of paint needed to paint the walls of the room.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter5: Control Structures Ii (repetition)
Section: Chapter Questions
Problem 28PE
icon
Related questions
Question

C++ Programming 

 

Instructions

A room has one door, two windows, and a built-in bookshelf and it needs to be painted. Suppose that one gallon of paint can paint 120 square feet.

Write a program that prompts the user to input (in feet):

  1. The length and width of the door
  2. The length and width of each window
  3. The length and width of the bookshelf
  4. The length, width, and height of the room
  5. The area that can be painted with one gallon of paint

The program outputs:

  1. The amount of paint needed to paint the walls of the room.

 

If I input "14" "5" "10" '10.5" "15 3.72" '15.23" "11.243" "92.77" "103.4" '21.5" "199.54"

The output should be "40.259"

 

If I input "55" "32" "33" "77" "33" "22" "15" "2" "225" "240" "14" "20"

The output should be "398.15"

 

 

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Mathematical functions
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
C++ for Engineers and Scientists
C++ for Engineers and Scientists
Computer Science
ISBN:
9781133187844
Author:
Bronson, Gary J.
Publisher:
Course Technology Ptr