/***************************************************************** * Program 0: First Program * Programmer: Insert your name here * * Due Date: * Class: COMP 110-003 Instructor: Luv Kohli * * Pledge: I have neither given nor received unauthorized aid * on this program. (signature on file) * * Description: This program prints out a greeting to the world and adds two numbers. * * Input: Two numbers * * Output: A friendly greeting, a request for two numbers, the sum of two numbers * ******************************************************************/ import java.util.*; public class FirstProgram { public static void main(String[] args) { System.out.println("Please enter your name:"); Scanner keyboard = new Scanner(System.in); String name; name = keyboard.nextLine(); System.out.println("Hello " + name + "!"); System.out.println("I will add two numbers for you."); System.out.println("Enter two numbers on a line, separated by a space:"); int n1, n2; n1 = keyboard.nextInt(); n2 = keyboard.nextInt(); System.out.println("The sum of those two numbers is"); System.out.println(n1 + n2); } }