C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
expand_more
expand_more
format_list_bulleted
Bartleby Related Questions Icon
Related questions
Question
Need help writing code to answer this question in Python! (image attached)
Transcribed Image Text:Overview: Write a program that prints the number of gallons of paint you need for a rectangular
room of any length, width, and height, assuming a gallon of paint covers 100 sq ft of room.
Requirements:
Input: Your program gets inputs from the user, which are length, width, and height of the room.
Each of these inputs should have try except validation loop to ensure the user enter valid data
(numeric and > 0) 10 points
Constants: a gallon of paint covers 100 SQ FT of wall and this should be a constant at the top of
your program - 2 points
Processing: The area of a rectangular room is (2 * length *height) + (2 * width * height). Your
program should round up to the nearest whole gallon of paint. In other words, if you need
4.15 gallons, you can't buy .15 gallons, so round up to 5 gallons. -10 points
Output: Your program should use the new print f string for the output, which is the number of
gallons of paint to buy - 2 points
Your test cases should include:
1) a computation that results with the exact number of gallons like a room 10 ft long 10 feet wide
and 10 feet high
2) a room that is not an exact number of gallons where you have to round up like the 4.15 gallon
that gets rounded up to 5 gallons in the example above - 6 points
Expert Solution
Check MarkThis question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
bartleby
Step by stepSolved in 2 steps with 3 images
Knowledge Booster
Background pattern image
Recommended textbooks for you
- Text book imageC++ for Engineers and ScientistsComputer ScienceISBN:9781133187844Author:Bronson, Gary J.Publisher:Course Technology PtrText book imageMicrosoft Visual C#Computer ScienceISBN:9781337102100Author:Joyce, Farrell.Publisher:Cengage Learning,Text book imageC++ Programming: From Problem Analysis to Program...Computer ScienceISBN:9781337102087Author:D. S. MalikPublisher:Cengage Learning
- Text book imageEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTText book imageProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:CengageText book imageProgramming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage Learning
Text book image
C++ for Engineers and Scientists
Computer Science
ISBN:9781133187844
Author:Bronson, Gary J.
Publisher:Course Technology Ptr
Text book image
Microsoft Visual C#
Computer Science
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Cengage Learning,
Text book image
C++ Programming: From Problem Analysis to Program...
Computer Science
ISBN:9781337102087
Author:D. S. Malik
Publisher:Cengage Learning
Text book image
EBK JAVA PROGRAMMING
Computer Science
ISBN:9781337671385
Author:FARRELL
Publisher:CENGAGE LEARNING - CONSIGNMENT
Text book image
Programming Logic & Design Comprehensive
Computer Science
ISBN:9781337669405
Author:FARRELL
Publisher:Cengage
Text book image
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:9781337102124
Author:Diane Zak
Publisher:Cengage Learning