1a) 1. I 2. O 3. O 4. I 5. I 6. O b) Any two methods for the class String 2. There are a number of possible solutions. Here is one: import java.io.*; class Test { private static BufferedReader input; private static PrintStream output; public static void main(String[] args) throws IOException { InputStreamReader k = new InputStreamReader(System.in); input = new BufferedReader(k); output = new PrintStream(new FileOutputStream("testout.txt")); System.out.println("Type 1 for file, 2 for display"); String response = input.readLine(); if (response.equals("1")) output.println("This is a file"); else if (response.equals("2")) System.out.println("This is the display"); else System.out.println("You didn't follow instructions!"); output.flush(); output.close(); } } Note that this construction does _not_ work: int intResponse = Integer.parseInt(input.readLine()); if (intResponse == 1) output.println("This is a file"); else if (intResponse == 2) System.out.println("This is the display"); else System.out.println("You didn't follow instructions!"); since Integer.parseInt() throws an exception (gives an error) if the user types in alphabetic characters, for example. 3a) (i) (local variables) w, site, stringRepresentation (ii) (instance variables) numVisitors, name (iii) (vars. that getVersion() can use) url, versionInfo b) 1. error 2. okay 3. error 4. error 5. error 6. error 7. error 8. okay 9. error 10. okay c) You are looking at Website http://www.cs.utoronto.ca/~csc108h entitled Java 108 Version 2.0 d) You are looking at Website http://www.cs.utoronto.ca/~csc108h entitled Java 108 Version 1.01 Bonus Again, there are a number of possibilities. One is: String machineName = site.substring(7, site.indexOf("/",7));