Question: 3 . 2 0 LAB * : Program: Painting a wall - Fall 2 0 2 4 Output each floating - point value with two
LAB: Program: Painting a wall Fall
Output each floatingpoint value with two digits after the decimal point, which can be achieved as follows:
print:fformatyourvalue
Prompt the user to input a wall's height and width. Calculate and output the wall's area integer You will need to multiply the width by the height to do this.
Hint: The first variable is assigned for you, and print statement is started for you. You will need to finish creating the variables and complete the print statement.
Hint: You will need to use the format function to format your print statement. Submit for points
Enter wall height feet:
Enter wall width feet:
Wall area: square feet
Extend to also calculate and output the amount of paint in gallons needed to paint the wall floating point Assume a gallon of paint covers square feet. Store this value in a variable.
Hint: Output the amount of paint needed using the format function with the f conversion specifier. This will display the gallons as a float with two decimal places. Submit for points, so points total
Enter wall height feet:
Enter wall width feet:
Wall area: square feet
Paint needed: gallons
Extend to also calculate and output the number of gallon cans needed to paint the wall. Hint: Use the math.ceil function to round up to the nearest gallon. You will want to put your variable that you are rounding up in the parentheses of the math.ceil function.
Hint: You will need to use the format function to format your print statement. Submit for points, so points total
Enter wall height feet:
Enter wall width feet:
Wall area: square feet
Paint needed: gallons
Cans needed: cans
Extend by prompting the user for a color they want to paint the walls. Calculate and output the total cost of the paint cans depending on which color is chosen.
Hint: Use the dictionary item THAT IS ALREADY CREATED FOR YOU to associate each paint color with its respective cost. Red paint costs $ per gallon can, blue paint costs $ per gallon can, and green paint costs $ per gallon can.
Hint: To determine the total paint cost you will need to multiple the paint cost for your wall color by the number of cans needed that you calculated in step
Hint: You will need to use the format function to format your print statement. Submit for points, so points total
Enter wall height feet:
Enter wall width feet:
Wall area: square feet
Paint needed: gallons
Cans needed: cans
Choose a color to paint the wall:
red
Cost of purchasing red paint: $
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
