Lawn mowing algorithm input identifiers : name yardWidth, yardLength houseWidth, houseLength output identifiers : cost, weekendCost others : squareMetreCost lawnArea Comment: Algorithm to calculate the cost to mow a lawn Comment: Written by Rex Forsyth Comment: Jan 30, 2007 Comment: Sample for tutorial in CS1620 Spring 2007 Comment: declare identifiers name = "" yardWidth = 0 yardLength = 0 houseWidth = 0 houseLength = 0 squareMetreCost = .55 cost = 0 weekendCost = 0 lawnArea = 0 Comment: get input Print "Enter your name -- " Get name Print "Enter the length and width of the yard in metres -- " Get yardLength yardWidth Print "Enter the length and width of the house in metres -- " Get houseLength houseWidth Comment : calculate the area of the lawn lawnArea = yardLength*yardWidth - houseLength*houseWidth Comment : calculate the cost to mow the lawn cost = lawnArea * squareMetreCost Comment : calculate the cost to mow the lawn on the weekend weekendCost = cost + (1/3)*cost Comment : display the results Print "The cost to mow " name "'s lawn during the week is $" cost Print "The cost to mow " name "'s lawn on the weekend is $" weekendCost