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): 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.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question
100%

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.
O Assignments: 21/FA-CSC-133-76 x
* MindTap - Cengage Learning
b My Questions | bartleby
A ng.cengage.com/static/nb/ui/evo/index.html?deploymentld=5781122319546088747421251303&elSBN=9781337274715&id=1306226456&snapshotld=2618406&
* CENGAGE MINDTAP
Q Search this course
Mohammad v
Programming Exercise 2-27
Tasks
main.cpp
+
>- Terminal
66
Tasks Correct output calculated and
displayed
67
double Bookshelf = areaCalc(bLen, bWid);
68
A-Z
0.00
Enter the length and width of s
out of
10,00
69
econd window: 10
70
O out of 2 checks passed. Review the
71
double Door = areaCalc(dLen, dWid);
1110
72
results below for more details.
area = Door + Windows + Bookshelf;
Enter the length and width of t
he bookshelf:10.5
73
74
Checks
75
76
room_Area = areaSurface(rLen, rHt, rWid);
3
Test Case • Incomplete
>
Enter the length, width, and he
ight of the room: 3.72
77
rem_Area = room_Area
area;
Test case 2
78
2
79
gallons = room_Area / 120.0;
Test Case • Incomplete
80
22
Test case 1
81
cout <« "The amount of paint needed to paint the ro
The amount of paint needed to p
gallons <<" gallons."<< endl;
aint the room: 2.22133 gallons.
sh: 1: pause: not found
sandbox $
82
83
84
Run checks
A Submit O%
21996.1.210529-15..iso
Show all
2.5/4.5 GB, 1 hour left
8:30 PM
11/18/2021
!!!
Transcribed Image Text:O Assignments: 21/FA-CSC-133-76 x * MindTap - Cengage Learning b My Questions | bartleby A ng.cengage.com/static/nb/ui/evo/index.html?deploymentld=5781122319546088747421251303&elSBN=9781337274715&id=1306226456&snapshotld=2618406& * CENGAGE MINDTAP Q Search this course Mohammad v Programming Exercise 2-27 Tasks main.cpp + >- Terminal 66 Tasks Correct output calculated and displayed 67 double Bookshelf = areaCalc(bLen, bWid); 68 A-Z 0.00 Enter the length and width of s out of 10,00 69 econd window: 10 70 O out of 2 checks passed. Review the 71 double Door = areaCalc(dLen, dWid); 1110 72 results below for more details. area = Door + Windows + Bookshelf; Enter the length and width of t he bookshelf:10.5 73 74 Checks 75 76 room_Area = areaSurface(rLen, rHt, rWid); 3 Test Case • Incomplete > Enter the length, width, and he ight of the room: 3.72 77 rem_Area = room_Area area; Test case 2 78 2 79 gallons = room_Area / 120.0; Test Case • Incomplete 80 22 Test case 1 81 cout <« "The amount of paint needed to paint the ro The amount of paint needed to p gallons <<" gallons."<< endl; aint the room: 2.22133 gallons. sh: 1: pause: not found sandbox $ 82 83 84 Run checks A Submit O% 21996.1.210529-15..iso Show all 2.5/4.5 GB, 1 hour left 8:30 PM 11/18/2021 !!!
O Assignments: 21/FA-CSC-133-76 x
* MindTap - Cengage Learning
b My Questions | bartleby
A ng.cengage.com/static/nb/ui/evo/index.html?deploymentld=5781122319546088747421251303&elSBN=9781337274715&id=1306226456&snapshotld=2618406&
* CENGAGE MINDTAP
Q Search this course
Mohammad v
Programming Exercise 2-27
Tasks
main.cpp
+
>- Terminal
66
Tasks Correct output calculated and
displayed
67
double Bookshelf = areaCalc(bLen, bWid);
68
A-Z
0.00
Enter the length and width of s
out of
10,00
69
econd window: 10
70
O out of 2 checks passed. Review the
71
double Door = areaCalc(dLen, dWid);
1110
72
results below for more details.
area = Door + Windows + Bookshelf;
Enter the length and width of t
he bookshelf:10.5
73
74
Checks
75
76
room_Area = areaSurface(rLen, rHt, rWid);
3
Test Case • Incomplete
>
Enter the length, width, and he
ight of the room: 3.72
77
rem_Area = room_Area
area;
Test case 2
78
2
79
gallons = room_Area / 120.0;
Test Case • Incomplete
80
22
Test case 1
81
cout <« "The amount of paint needed to paint the ro
The amount of paint needed to p
gallons <<" gallons."<< endl;
aint the room: 2.22133 gallons.
sh: 1: pause: not found
sandbox $
82
83
84
Run checks
A Submit O%
21996.1.210529-15..iso
Show all
2.5/4.5 GB, 1 hour left
8:30 PM
11/18/2021
!!!
Transcribed Image Text:O Assignments: 21/FA-CSC-133-76 x * MindTap - Cengage Learning b My Questions | bartleby A ng.cengage.com/static/nb/ui/evo/index.html?deploymentld=5781122319546088747421251303&elSBN=9781337274715&id=1306226456&snapshotld=2618406& * CENGAGE MINDTAP Q Search this course Mohammad v Programming Exercise 2-27 Tasks main.cpp + >- Terminal 66 Tasks Correct output calculated and displayed 67 double Bookshelf = areaCalc(bLen, bWid); 68 A-Z 0.00 Enter the length and width of s out of 10,00 69 econd window: 10 70 O out of 2 checks passed. Review the 71 double Door = areaCalc(dLen, dWid); 1110 72 results below for more details. area = Door + Windows + Bookshelf; Enter the length and width of t he bookshelf:10.5 73 74 Checks 75 76 room_Area = areaSurface(rLen, rHt, rWid); 3 Test Case • Incomplete > Enter the length, width, and he ight of the room: 3.72 77 rem_Area = room_Area area; Test case 2 78 2 79 gallons = room_Area / 120.0; Test Case • Incomplete 80 22 Test case 1 81 cout <« "The amount of paint needed to paint the ro The amount of paint needed to p gallons <<" gallons."<< endl; aint the room: 2.22133 gallons. sh: 1: pause: not found sandbox $ 82 83 84 Run checks A Submit O% 21996.1.210529-15..iso Show all 2.5/4.5 GB, 1 hour left 8:30 PM 11/18/2021 !!!
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 3 images

Blurred answer
Knowledge Booster
Random Class and its operations
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education