Michael Siltz January 22, 2007 Section 1 Lab 4 Lab: Experimenting with Input/Output 3.3. What was the first error generated by the compiler? Cannot find Symbol for class PrintWriter; 3.4. What line did you need to add? import java.io.PrintWriter; 3.6. What was the first error generated by the compiler this time? Cannot find Symbol for class Scanner 3.7. Fix this error. What line did you need to add? import java.util.Scanner; 4.4. Why was no output generated? Because the string was in the buffer and in order to output the string the buffer needs to be flushed. 4.5. Fix this mistake. What line did you add? screen.flush(); 4.6. What do you need to type in the terminal window (as a response to the prompt) in order to make this application terminate normally? Ctrl+Z 5.4. What output was generated? Today's Date: 22 January 2007 Birthday: Sir Francis Bacon Birthday: George Foreman 5.6. What happened and why? It outputted "The system cannot find the file specified" because there was no anniversarys.txt in the directory. 5.8 What changes did you need to make? Added File dates; to the program. 5.10. What changes did you need to make? Added dates = new File(args[0]); 5.12. What changes did you need to make? Changed dateScanner = new Scanner(System.in); to dateScanner = new Scanner(dates); Added a try,catch in order to catch a FileNotFoundException 5.14. What output was generated? Today's Date: 22 January 2007 Birthday: Sir Francis Bacon Birthday: George Foreman 6.2. What changes did you need to make? Made dates an array. Added a for loop in order to catch all the command line arguments from index = 0 to index < args.length, and creating a new File object for each argument. Also, instantiating dateScanner with each new File object. 6.4. What output was generated? Today's Date: 22 January 2007 Birthday: Sir Francis Bacon Birthday: George Foreman Programming Assignment 1 Due Review the Java tutorial on Exceptions