0021: import java.util.Scanner; // SumProgNew.java 0022: public class SumProgNew 0023: { 0024: public static void main(String[] pArgs) 0025: { 0026: Scanner tScanner = new Scanner(System.in); 0027: System.out.print("Type in your first number: "); 0028: double tFirst = tScanner.nextDouble(); 0029: System.out.print("Type in your second number: "); 0030: double tSecond = tScanner.nextDouble(); 0031: double tSum = tFirst + tSecond; 0032: System.out.println("The sum of " + tFirst + 0033: " and " + tSecond + " is " + tSum); 0034: } 0035: }
0036: Type in your first number: 27 0037: Type in your second number: 42 0038: The sum of 27.0 and 42.0 is 69.0