15-100 Lecture 35 (Monday April 25, 2005)

Exam 3 (Retake)

There were about 12 people who scored a 100%. However, the class average for the exam was about 60%. You will not get your exam score back unless you were in class or go and talk to Kesden. Since so many people got a bad score on the exam and this class (and the exam) WILL NOT BE CURVED, there will be a retake on exam 3 on Thursday.

If you come on Thursday and do the retake, the retake grade will replace the exam 3 score (whether is better or worse than the original). So do not take the retake unless you are positive that you have a better/ deeper understanding of arrays. However, Kesden's offer to replace exam 2's score with exam 3's score (if it is better) still stands for the retake. We hope to see you at the retake if you chose to come.

Remember there are office hours in Wean Hall 5419 from 7:30-10:30 every Sunday-Thurs. If you have any questions there will always be two CA's in the lab awaiting your questions. Equally useful are Kesden's office hours or the 15100-help@cs.cmu.edu email to all of the CA's and Kesden.

Helpful hints for studying

If you did all of the labs but don't understand them, go back through the labs and redo them. Start from scratch. On a blank piece of paper, do examples of how the labs should run and try to understand what the program should be doing. Then take all the examples and try to extrapolate the patterns that your examples suggest...aka turn the patterns into code. Do all of this from scratch...do not write any code that you do not understand. (This includes copying code from lecture notes, getting help from friends, etc). By using code that you don't understand you are undermining your success in this class. If you don't understand arrays it will be very hard (short of memorizing all of the possible code...which is a lot, plus you will have to write it first anyways) to pass the Mastery Exam.

Passing the Mastery:

Schedule a late exam time (in the second week of classes). So that you have as much time to understand the code/ concepts that the Mastery will be testing you on.

Please let us help you if you don't understand the material covered in class. We are here to help.

Common Conceptual problems

An array is a first class object. It is an object that has the property of being an indexed collection (you can get information that is contained at a specific index).

Container on the exam is also a first class object (Container boyNames = new Container();). With in Container was another reference to the array items of Comparable items (Comparable [] items). Items and boyNames reference two different objects that cannot be used in the same way. It will cause a complier error if you try to code: this[5] or Container[5].

A common problem that we saw was Container [] alternatingNames = new Container[count]. This would be creating an array of Containers. Where each Container would have another items list and then the items would contain a reference to the boys'/girls' names. This is one more level of abstraction than we need. That code would produce an array of arrays (Since Container has an array as part of it). The Container has a reference to an array...but is not an array in and of itself (sort of like how people have a heart but are not a heart...the heart is part of the body just as the array was part of Container).

BoyGirl Exam:

public Container mergeAlternate(Container other) {
	Container sorted = new Container();
  int index1 = 0;
	int index2 = 0;
	while(index 1< count && index2