import cs1.Keyboard; /** Calculate average speed given distance and time. @author Greg Vogl last modified 2003-09-22 */ public class Speed { /** Calculate average speed given distance and time. */ public static void main (String[] args) { // get input System.out.println("Calculate average speed given distance and time."); System.out.println("Enter the distance in kilometers and press Enter."); float distance = Keyboard.readFloat(); System.out.println("Enter the time in hours and press Enter."); float time = Keyboard.readFloat(); // calculate statistics float speed = distance / time; // output results System.out.println("The average speed is " + speed + " kilometers per hour."); } }