Question: can anyone help me fix this problem? It's a Python problem Include function showCostEstimate that accepts the gallons of paint, hours of labor, cost of
can anyone help me fix this problem?
It's a Python problem
Include function showCostEstimate that accepts the gallons of paint, hours of labor, cost of paint, and cost of labor, calculates the total cost, and prints the data. Enter square feet to be painted: 120 Enter price per gallon of paint: 5 Gallons of paint: 2 Hours of labor: 16 Paint charges: $10.00 Labor charges: $560.00 Total cost: $570.00
What i have so far. The main function has to be the one do the calculation but it doesn't work
def showCostEstimate(): square_feet = int(input("Enter square feet to be painted: ")) gallons_price = int(input("Enter price per gallon of paint")) main(square_feet,gallons_price) def main(square_feet,gallons_price): gallons_paint = square_feet / 60 hours_labor = square_feet / 7.5 paint_charges = float(gallons_price * gallons_paint labor_charges = float(hours_labor * 35) total_cost = labor_charges + paint_charges print("Gallons of paint:", gallons_paint) print("Hours of labor:", hours_labor) print("Paint charges:$", format(paint_charges,'.2f'),sep ='') print("Total cost:$", format(total_cost,'.2f'),sep ='')
main()
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
