import java.util.Scanner;

/**
 * An example that illustrates the use of the Scanner class
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class ScannerExample
{
    /**
     * The entry point of the application
     *
     * @param args   The command-line arguments
     */
    public static void main(String[] args)
    {
       int        age, weight;
       double     salary;
       Scanner    keyboard;
       String     line, name;
       String[]   parts;       
       
       keyboard = new Scanner(System.in);
       
       System.out.print("Name: ");
       name = keyboard.nextLine();

       System.out.print("Salary: ");
       salary = keyboard.nextDouble();
       keyboard.nextLine(); // Consume the end-of-line character

       System.out.print("Phone number (###-###-####): ");
       line   = keyboard.nextLine();

       System.out.print("Age Weight (# #): ");
       age    = keyboard.nextInt();
       weight = keyboard.nextInt();

       keyboard.close();       
    }
}
