1 a. This is done by making the length field in an array final, so that it can only be assigned to once. 1pt all or nothing. b. Cy is right because although Strings are immutable you can change which String the reference "name" in Team points to. 1 pt, .5 given for right answer for wrong reason. c. Interfaces: Instructor, Resercher. Abstract classes: Person, Professor extends Person. Classes: FullProfessor extends Professor implements Instructor, Researcher ResearchProfessor extends Professor implements Researcher Lecturer extends Professor implements Instructor GradStudent extends Person, implements Researcher GSI extends GradStudent, implements Instructor 1pt, .5 given for minor mistakes. d. garply: [ |/| | |/| |/] | | | | | | | +-----------------------------------+ | | +------------------+ | | +------+ | | | V V V +->[ |-]->[ |-]->[ |-]->[ |-]->[ |-]->[ |-]->[ |-]->[ |/] | | | | | | | | 555 8 6 7 5 3 0 9 1pt, .5 given for minor errors. e. They have special syntactic features like allocation without using the new operator. 1pt, al lor nothing. f. 37. 1pt all or nothing. 2. To the left because you cant see the door. 1pt extra credit. 3 a. Boing!, 5, 9, 5, Not valid. Key observations: changestuff doesn't do anything, and calling getMyInt on a bar type returns 7. 2.5 pts, 0.5 for each line. b. Same thing. Key observation: parameters are never changed in any of the methods. 1.5 pts, all or nothing. Getting the right answer for the wrong reason (like saying java already has pass by reference) would get you .5, if that. 4. Many solutions exist, the one feature all of them share is that they have nested control structures: nested for loops, while loops, recursion, or some combination of the above. The answer we were expecting is static List removeAllDuplicates(List L) { if (L==null || L.tail == null) return L; for (List k = L; k.tail != null; k = k.tail) removeHelp(k); } static void removeHelp(List k) { Object o = k.head; for (List j = k.tail; j != null; j = j.tail) if (o.equals(j.head)) k.tail = j.tail; else k = k.tail; } If you didn't have nested control structures, we took off 3 pts. Other mistakes cost you anywhere from .5 pts (for forgetting null checks or returns to -2 for "idiotic pointer manuever." 5. You could have done this with one vector, two vectors, or two stack-like objects (somebody did this with two dequeus and others were even more exotic). Bascially, if you did vectors or arrays, you had to properly extend them when the user went beyond the current limits. If you didn't do bound checking, you lost 2 points. If you didn't deal with the case of adding extra zeros, you lost a point as well. If you didn't cast properly, you lost 0.5 or 1 point (depending on if it was just one mess up or a pattern of error). If you used one stack and just did trivial pushes and pops, you got zero unless you had some zero checking or bound checking. In those cases, you may have gotten 0.5-1.5 points depending on what you did. Those who didn't use a stack at all and simply accessed elements directly from some constant sized array got zero too, unless you realized your Turing machine was finite and implemented zero handling or boundary checking. To get a correct vector/array answer, you needed to use the insert method or create a new larger vector/array and copy the items over to it. If you forgot to write the no argument constructor, you lost a point. If you forgot to write the constructor with the array argument, you lost two points. Lots of points were taken off and big red marks given if you tried to instantiate an array of infinite size or did a non-terminating while loop that added to a stack. You lost a point if you forgot to implement the TuringMachine interface. Here's the solution we were looking for: class MyTuringMachine implements TuringMachine { // solution still coming... }