CSE 142 - Summer 2001
Section AH with Robert Carr


Section Two - June 28, 2001

Homework One Handed Back

I started off class by handing back the first homework. Everyone who did it did fine, it was graded out of 2 points (a 0, 1, or 2). There were only a couple problems that I noticed:

  • Many of you only did (or handed in) the end programming part. There were actually a few other questions that required responses, but it wasn't totally clear so we let that slide ... this time. In the future it is very important to completely read all the directions before you start the assignment, use the directions as a reference while completing the assignment, and reread the directions before you hand in the assignment. It sounds like a lot, but you will kick yourself if you lose points for omitting a small part or some other trivial case.

  • Question eight regarding qualites ... many of you just copied down what the object inspector told you, including every single number associated with every property. All we were looking for is the property itself, i.e. it has an x, y, length, width, height, color, etc ... these are the properties or qualities, not the values.

  • For the end programming part, or when programming in general, it is important to name your variables descriptively. Some students just did A, B, C, D, E for the names of the shapes, which is really bad. Some others did things like rect1, rect2, rect3 for the three rectangles, but that is also pretty bad. What would be better is blueRectangle, or upperLeftRectangle ... sure, these names are longer but they make a lot more sense.
  • BlueJ Implementtation versus Interface

    Since the homework requires you to write comments into your code (and so will every subsequent homework), I went over a little about how the 'interface' document is generated when you click that feature in then BlueJ editor.

    If you missed this, you can simply look at what the current Scene.java does do get an idea. The basic principle is some text parser reads over your code and looks for specific sequences ( /** explanations */, @param for parameter descriptions, etc ...) and generates a readable 'interface' based on that.

    Short Example

    At the end of section I had the students complete a short example that is similar to what is required for the next homework, hw2. It was similar to how the Scene.java code uses some method parameters in the method drawTree(), and uses different offsets (the word I was searching for) in order to correctly position the elements. If you completely understand the drawTree() method, you should have no problems at all.

    Homework Details

    Remember that homework is due at the beginning of class on Monday. It doesn't appear to be to hard, just use the starter code (Scene.java) as a starting point (duh) and go from there.

    For those of you that wish to work at home put can't get things set up yet, just keep trying different things until you (hopefully) get it worked out, but until then come into one of the labs (MGH or OUGL) to do the assignments. They are pretty short now so you shouldn't be too 'inconvenienced'.