// SumImproved.java (c) 2004 Kari Laitinen // This is a simple calculator program that can // calculate the sum of the two integers that are // typed in from the keyboard. import java.util.* ; class SumImproved { public static void main( String[] not_in_use ) { Scanner keyboard = new Scanner( System.in ) ; System.out.print( "\n Please, type in an integer: " ) ; int first_integer_from_keyboard = keyboard.nextInt() ; System.out.print( "\n Please, type in another integer: " ) ; int second_integer_from_keyboard = keyboard.nextInt() ; int sum_of_two_integers = first_integer_from_keyboard + second_integer_from_keyboard ; System.out.print( "\n The sum of " + first_integer_from_keyboard + " and " + second_integer_from_keyboard + " is " + sum_of_two_integers + ".\n" ) ; } }