C++ for Engineers and Scientists
C++ for Engineers and Scientists
4th Edition
ISBN: 9781133187844
Author: Bronson, Gary J.
Publisher: Course Technology Ptr
Bartleby Related Questions Icon

Related questions

Question

Need help writing code to answer this question in Python! (image attached)

[画像: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]
expand button
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 Mark
Knowledge Booster
Background pattern image
Recommended textbooks for you
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