//******************************************************************** // Program to calculate the cost to mow a lawn -- lawn.cc // // Written by : Rex Forsyth // Date : Jan 30, 2007 // Sample program for CS1620 Spring 2007 //******************************************************************** const SQR_METRE_COST = 0.55 int main() { double yardWidth, yardLength; double houseWidth, houseLength; double lawnArea; string name; cout << "Enter your name -- "; getline(cin,name); cout << "Enter the length and width of the yard in metres: "; cin << yardLength << yardWidth; cout << "Enter the length and width of the house in metres: "; cin >> houselength >> housewidth; lawnArea = yardLength*yardWidth - houseLength*houseWidth; cost = lawnArea * SQR_METRE_COST; weekendCost = cost + (1/3)*cost; cout << "The cost to mow " << name << "'s lawn during the week is $" << cost << endl; cout << "The cost to mow " << name << "'s lawn on the weekend is $" << weekendCost << end; return 0; }