CS100J,   Fall 2003   Preparing for Prelim 2: 

Tuesday, 21 Oct., 7:30—9:00PM, Uris Auditorium

This handout explains what you have to know for the second prelim.
There will be a review session on Sunday afternoon (19 Oct.). Exact time and place to be announced.

Material from the first prelim. The second prelim will cover all the material that was on the first prelim. This material was discussed on the handout for the first prelim. Please look at that handout (you can get it from the course website if you lost it).

In addition, you need to know the following.

1.	Methods — constructors. Secs. 3.1.3 and 3.1.4 of the text
• Know what a constructor is.
• Be able to write down how to evaluate a new expression, and also be able to do it.
• Be able to write a constructor that calls another constructor in the same class (using this) or calls a constructor in a superclass (using super).

2.	Methods — executing method calls. Secs. 2.7, 3.5, 4.6
• Be able to draw a frame for a method call, knowing what goes in the scope box depending on the method being called.
• Know about the call stack and how it is used.
• Be able to write down the steps involved in executing a method call.
• Be able to execute a method call by hand, drawing any frames and folders as necessary.

3. Class Vector
Be able to write simple programs that manipulate an instance of class Vector. Know about the size and the capacity of a Vector. We give you specifications of methods of class Vector that you may need. Remember that class Object is the superest class of them all and that it has functions equals and toString.

4. Loops
• Know the syntax and semantics of the while-loop.
• Be able to execute a loop that we give you.
• Know the four loopy questions.
• Given a loop with an invariant and postcondition, be able to tell whether the four loopy questions are satisfied. (For example, how does it start —does the loop initialization make the invariant true?)
• Be able to write simple while-loops.

5. Apparent and real classes
The class did not do so well on this topic in the first prelim. So we had an extra lecture on it. Please review Sec. 4.2.1.
.