import java.util.Scanner; import java.io.FileWriter; import java.io.IOException; public class TestSentences { public static void main( String[] args ) { // setup final int numQuestions = 50; long startTime = 0; long estTime = 0; long avgTime = 0; int numWords = 0; int numLetters = 0; double avgWords = 0; double avgLetters = 0.0; Scanner input = new Scanner( System.in ); FileWriter fileout = null; Sentences mysents = new Sentences( "greatexpectations.txt" ); mysents.processByLine(); System.out.println( "" ); // create data file System.out.println( "Enter your student number: " ); int id = input.nextInt(); input.nextLine(); int time = ( int )( System.currentTimeMillis() ); String filename = "" + id + "_" + time + "_read.txt"; System.out.println( "" ); // instructions System.out.println( "You will be presented with 50 sentences from a novel. " ); System.out.println( "Read each sentence as carefully as you can. " ); System.out.println( "(You may want to read aloud to yourself -- but if you do this, do this for every sentence.) " ); System.out.println( "After each sentence, press a key to go onto the next sentence. " ); System.out.println( "When you are done, submit the log file that has been generated. " ); System.out.println( "" ); System.out.println( "When you are ready to start, press any key." ); String tmp = input.nextLine(); System.out.println( "" ); try { fileout = new FileWriter( filename ); for( int i=0; i