import java.io.*;
import java.util.*;



/**
 * An example that illustrates the use of the Scanner class
 *
 * @author  Prof. David Bernstein, James Madison University
 * @version 1.0
 */
public class BufferedReaderExample
{
    /**
     * The entry point of the application
     *
     * @param args   The command-line arguments
     * @throws IOException if any line can't be read
     */
    public static void main(String[] args) throws IOException
    {
        BufferedReader      in;
        double              salary;        
        InputStreamReader   isr;
        int                 age, weight;        
        String              line, name, phone;
        String[]            tokens;
        StringTokenizer     st;        

        isr = new InputStreamReader(System.in);
        in  = new BufferedReader(isr);

        System.out.print("Name: ");
        name = in.readLine();

        System.out.print("Salary: ");
        line   = in.readLine();
        salary = Double.parseDouble(line);

        System.out.print("Phone number (###-###-####): ");
        phone = in.readLine();

        System.out.print("Age Weight (# #): ");
        line   = in.readLine();
        // One way to tokenize: Using the split() method
        tokens = line.split(" ");
        age    = Integer.parseInt(tokens[0]);
        weight = Integer.parseInt(tokens[1]);
        // Another way to tokenize: Using a StringTokenizer
        st     = new StringTokenizer(line, " ");
        age    = Integer.parseInt(st.nextToken());
        weight = Integer.parseInt(st.nextToken());
        

        in.close();
    }
    
    
}
