Write a program that calculates the cost of landscaping Pyth

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

Solution


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

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 lands

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site