Solution to Java Quiz Dec 4, 2008 1. Part A. k son tored 6 1 2 2 1. Part B This counts the number of strings in manyStrings that have the word cat in them. 2. public String extract(String dna) { String answer = ""; // new string to build for (char ch: dna.toCharArray()) { if ((ch == 'a') || (ch == 'g')) { answer = answer + ch; // append ch to right end of string } } return answer; } 3. // return the number of strings of length > num public int NumberLargeEnough (String [] words, int num) { int count = 0; for (String item: words) { if (item.length() > num) { count ++; } } return count; } 4. public double average (int [] values) { double sum = 0; double count = 0; for (int someNum: values) { sum = sum + someNum; count = count + 1; } return sum/count; }