DanLindsay.java

/** KilogramsToNewtonsConverter.java converts Kilograms to Newtons. * @author Dan Lindsay */ import java.util.Scanner; public class KilogramsToNewtonsConverter { public static void main(String[] args) { System.out.print("How many kilograms do you want to convert to Newtons?") ; Scanner kbd = new Scanner(System.in); // Java 1.5 or later double kilograms = kbd.nextDouble ; System.out.print("What is the Newtons-to-Kilograms exchange rate?") ; double newtonsPerKilogram = kbd.nextDouble ; double newtons = kilograms * newtonsPerKilogram ; System.out.println(kilograms + " kilograms => " + newtons + " newtons") ; }