Question: Program #2 Algorithm: 1.Using input statement ask user for square feet of wall space to be painted 2.Using input statement ask user for the price

Program #2

Algorithm: 1.Using input statement ask user for square feet of wall space to be painted 2.Using input statement ask user for the price of a gallon of paint 3.Calculate the number of gallons of paint required -Divide the wall space to be painted by 112 -Print the result as the amount of gallons required 4.Calculate the cost of the paint -Multiply cost of paint by the amount of gallons required -Allow for a non-whole-dollar price using float function. 5.Calculate the amount of hours of labor required -Multiply the amount of gallons required by 8 6. Calculate the labor charges -Multiply the amount of hours of labor by 35 7. Calculate total cost of the job -Add total cost of paint to the labor charges 8. Print the total cost of the job

def main(): wall_space = int(input('Enter the square feet of wall space to be painted: ')) gallon_price = float(input('Enter the price of a gallon of paint: ')) estimator(wall_space,gallon_price)

def estimator(wall_space,gallon_price): paint_required = (wall_space/112) if paint_required%2 == 0 : paint_required = paint_required+1 else : paint_required = paint_required cost_paint = format((gallon_price * paint_required),'.2f') labor_hours = (paint_required * 8) labor_charge = (labor_hours * 35) total_cost = (cost_paint+labor_charge) print('The amount of paint required is ',paint_required,'gallons.') print('The cost of the paint is $'+cost_paint+'.') print('The required hours of labor are ',labor_hours,'hours.') print('The labor charge is $'+labor_charge+'.') print('The total cost of the job is $'+total_cost+'.') main()

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!