/* Author : Michael Robinson Program : inkey.java Purpose : This program uses the Formatter class this is a very quick way to create the file called fileone then we write data into into and finally close it. ************** WARNING ****************** this program will produce a text file of size close to three gigabytes Updated : Jan 29, 2099 */ import java.util.*; import java.io.*; public class inkey { public static void main( String arg[] ) { Scanner kb = new Scanner(System.in); System.out.print( "Enter Y or N: " ); String inFile = kb.nextLine(); String letter = inFile.substring(0,1).toUpperCase(); System.out.println( letter.compareTo( "Y" ) ); //displays the distance from Y's ASCII code if( letter.compareTo( "Y" ) == 0 ) { System.out.print( "I received " + letter + " thank you\n" ); System.exit(0); } }//end public static void main( String arg[] ) }//end public class inkey