These are the tasks that users were asked to complete in the web based study. The code that users were meant to write is put inside triple <<< >>>'s. ------------------------------------------------------------- Task 1: // convert "1 2 3 4" --> "1,2,3,4" public String spacesToCommas(String message) { String space = " "; String comma = ","; return <<>>; } ------------------------------------------------------------- Task 2: // convert "100" --> 100 String input = "100"; int output = <<>>; ------------------------------------------------------------- Task 3: // make sure that the list has no more than the // given number of elements public void trimSize(List list, int noMoreThan) { while (list.size() > noMoreThan) { list.remove(<<>>); } } ------------------------------------------------------------- Task 4: public boolean isFruit(String food) { Set fruits = new HashSet(getFruitList()); return <<>>; } ------------------------------------------------------------- Task 5: public boolean isVowel(char c) { String vowels = "aeiou"; return -1 != <<>>; } ------------------------------------------------------------- Task 6: Map numberNames = new HashMap(); Integer key = 3; String value = "Three"; // make numberNames have the entry: // 3 --> "Three" <<>>; ------------------------------------------------------------- Task 7: public int absoluteValue(int x) { // use standard java method to // return the absolute value of x return <<>>; } ------------------------------------------------------------- Task 8: public Vector getTokens(String message) { Vector tokens = new Vector(); StringTokenizer st = new StringTokenizer(message, " "); while (st.hasMoreTokens()) { <<>>; } return tokens } ------------------------------------------------------------- Task 9: // count the a's String message = "how many a's are in this message?"; int count = 0; for (int i = 0; i < message.length(); i++) { char c = <<>>; if (c == 'a') { count++; } } ------------------------------------------------------------- Task 10: // example output: // autoexec.bat // config.sys // Documents and Settings // Windows public void ls(File dir) { for (File f : dir.listFiles()) { <<>>; } } ------------------------------------------------------------- Task 11: public String repeatString(String s, int thisManyTimes) { StringBuffer buf = new StringBuffer(); for (int i = 0; i < thisManyTimes; i++) { <<>>; } return buf.toString(); } ------------------------------------------------------------- Task 12: public List getLines(BufferedReader in) { List lines = new Vector(); while (in.ready()) { <<>>; } return lines; } ------------------------------------------------------------- Task 13: public void logMessage(String message) { PrintWriter log = new PrintWriter( new FileWriter("log.txt", true)); <<>>; log.close(); } ------------------------------------------------------------- Task 14: // convert "HeLLo WoRlD" --> "hello world" String input = "HeLLo WoRlD"; String output = <<>>; ------------------------------------------------------------- Task 15: String filename = "input.txt"; BufferedReader in = <<>>; in.read(...); in.close();