Question #46042

Code a program to calculate the time in minutes for someone to cut a yard. Input the length and width of the yard in feet. Input the length and width of the house in feet. Subtract the area of the house from the area of the yard to determine the amount of grass to be cut. Using 2 square feet per second as the rate at which you can cut the grass (set this up as a constant), determine how long it will take someone to mow the lawn, in minutes.
The program should print:
Length and width of yard
Length and width of house
Area to be cut in square feet
Time to mow the yard in minutes
Input data: (run three times)
Yard - 1500 X 1600 feet
House - 500 X 700 feet
Yard – 4850 X 6000
House – 1000 X 2000

Expert's answer

` System.`*out*.println("Widthof the house: ");

**float** hWidth = scanner.nextFloat();

**float** time = (yLength * yWidth - hLength * hWidth) / 2;

System.*out*.format("Time:%.3f", time);

}

}

## Comments

## Leave a comment