CS 110 Fundamentals of Computing
Homework Assignment 3
Bolker and Rodriguez
Spring 2004

Due dates:

turnin: Thursday, February 19, when labs close

hard copy: Wednesday/Thursday February 18/19, in class

Read the first part of Chapter 3 in JOI and get hard copy of TextFile.java.

  1. JOI Exercise 3-10, but for file Lens.java discussed in Chapter 1. You can find the source code on the web page or the JOI CD.

    Do not worry about "scope" since we haven't talked about it yet.

    You need not understand anything about what the Lens class does in order to do this exercise. You just need to know how to read Java. Of course you can compile and run and study the TrafficLight application if you like.

  2. JOI Exercise 3-11, but for file Lens.java.

    Most of this is straightforward, but there are a few places where you may find it difficult to figure out what is going on. If you are confused, try to explain why in your memo. An honest discussion of what is puzzling is worth more than a wrong guess. Don't fake an answer in hopes of getting it right.

  3. JOI Exercise 3-4 ( setModDate() ).

  4. Draw two box-and-arrow pictures, one representing the state of the TextFile instance at line 163 of the main method in class TextFile and then one representing the state at line 174. Make sure your work is neat and labelled with your name and section number. Turn it in in class.

  5. Learn something new and useful or interesting about working in emacs, and describe what you learned.

  6. Visit the Java language API on line and write a few paragraphs about some of the public methods of some class you find interesting. The point of this exercise is to learn to find and read the javadoc for classes you care about.

  7. Optional. JOI Exercise 3-3. If you do this problem be sure to discuss it in your memo so we grade it.
    From: Ethan Bolker 
    to: eb@cs.umb.edu
    Subject: interactive testing
    Date: Tue, 17 Feb 2004 13:37:01 -0500 (EST)
    
    There should be NO interactive testing in your TextFile main
    method. If you write code that requires user input the script we run
    to test your program will wait forever, and the graders will be very
    annoyed ...
    
    You will have to find another way to see that your setModDate really
    works. That may mean writing a test and running it and talking about
    the results in your memo but not including that code in the
    TextFile.java you turn in.