// Reading floating point numbers using the Keyboard // class from the book. import cs1.Keyboard; class Yard3 { final static float YardsToMeters = 0.8f; public static void main (String[] args) { System.out.print ("Enter the width of the yard: "); System.out.flush(); float yardWidth = Keyboard.readFloat(); System.out.print ("Enter the length of the yard: "); System.out.flush(); float yardLength = Keyboard.readFloat(); System.out.print ("Enter the width of the house: "); System.out.flush(); float houseWidth = Keyboard.readFloat(); System.out.print ("Enter the length of the house: "); System.out.flush(); float houseLength = Keyboard.readFloat(); float yardArea = yardWidth * yardLength; float houseArea = houseWidth * houseLength; float grassArea = yardArea - houseArea; float grassAreaInSqM = grassArea * YardsToMeters; float timeInSec = grassAreaInSqM / 2; float timeInMin = timeInSec / 60; System.out.println ("The time to cut the grass is " + timeInMin + " minutes."); } }