/*
	Sample application using System.in and Text class
	cucs  hp  7/97, 8/97, 1/98, 3/98, 6/98	
*/

import java.io.*;

public class CUCSApplication {
    
    public static void main(String args[]) {
	int	 k;
	double	 d;
	String	 s;
	
	// initialize Text object in to read from standard input.
	TokenReader in = new TokenReader(System.in);
		
	// Read and write some numbers and strings
	System.out.print("Please enter an integer: ");
	System.out.flush();
	k = in.readInt();
	System.out.println("Thanks for the " + k +".\n");
	System.out.print("Please enter a floating-point number: ");
	System.out.flush();
	d = in.readDouble();
	System.out.println("Thanks for the " + d + ".\n");
	System.out.println("Please enter a line of input containing anything:");
	s = in.readLine();
	System.out.println("Input was: " + s + '\n');
	System.out.println("Enter a sequence of words.  Enter bye to stop.");
	while (!s.equals("bye")) {
	    s = in.readString();
	    System.out.println(s);
	}
		
	// Wait for user to enter input to ensure console window remains visible
	in.waitUntilEnter();
    }

}
