Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Write a program that calculates the cost of landscaping. (Python) Assume you hav

ID: 3937188 • Letter: W

Question

Write a program that calculates the cost of landscaping. (Python)

Assume you have a landscaping company and you want to give out estimates for the cost of landscaping. The cost of landscaping is calculated from a fixed cost and a variable cost. The fixed cost is a flat fee of $20 for showing up and the variable cost depends on the size of the land. We assume the land is rectangular and its area is length times the width. The variable cost is 25 cents per square foot. The program should:

- Define fixed cost to $20

- Define variable cost to .25

- Prompt the user to enter the length of the land

- Prompt the user to enter the width of the land

- Call the procedure to calculate the cost of landscaping. The four parameters passed to the procedure are length, width, fixed cost and the per square foot cost.

- Add an 8 percent sales tax

- Print the total cost

Explanation / Answer


def cost(l,w,fc,sf):   
return float(fc)+(float(l)*float(w)*int(sf))

length = raw_input('Enter length ')
print length;
width = raw_input('Enter width ')
print width;
print "cost is ", cost(length,width,25,4)
print "total cost after adding service tax is ", cost(length,width,25,4)*108/100

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote