(4) Extend by prompting the uscr tora color they want to paint the walls Calculate and output the total cost of thc paint cans depending on which color chosen Hint: Use dictionary to associate each paint color with its respective cost Red paint costs S35 per gallon can, blue Paint costs S25 per gallon can, and green paint costs 523 per gallan = can: Submit for points points total) Wall arca: 180 square fcet Paint needed: 0.51 gallons Cans needed: can ( 9) Hint: Use malh function t0 round up to the nearest gallon: (Submit for points sO points total): (3) Extend to also calculate ard oulput the number of - gallon cans needed t0 paint the wall. Wall 9rea= 180 square feet Paint needed: 0.51 gallons Assume gallon = of paint covers 350 square eet: Store Ihis value in variable: Output the amount of paint needed using the %f corversion specifier: (Submit for 2 points SO points total) Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('Įxtend to also calculate and output the amount of paint in gallons needed to paint the wall (floating point). Red paint costs $35 per gallon can, blue paint costs $25 per gallon can, and green paint costs $23 per gallon can. Hint: Use a dictionary to associate each paint color with its respective cost. Calculate and output the total cost of the paint cans depending on which color is chosen. (2 points).(4) Prompting the user for a color they want to paint the walls. Hint: Use a math function to round up to the nearest gallon. (2 points).(3) Calculate and output the number of 1 gallon cans needed to paint the wall. Output the amount of paint needed using the %f conversion specifier. Assume a gallon of paint covers 350 square feet. (2 points).(2) Calculate and output the amount of paint in gallons needed to paint the wall (floating point). SOLVED: Output each floating-point value with two digits after the decimal point, which can be achieved as follows:print('.2f'.format(yourvalue))(1) Prompt the user to input a wall's height and width and calculate and output the wall's area (integer).
0 Comments
Leave a Reply. |