CSSE 221: Fundamentals of Software Development Honors

Homework to do before week 1 (due before beginning of class on Monday, Sept 3)

  1. If you had any problems installing Eclipse, TortoiseSVN, or Subclipse, fix them. There will be an assistant in Moench F217 from 7-9pm on Thursday and Sunday nights to help you.
  2. Finish the JavaEyes assignment, including the questions below.
  3. Skim Weiss chapters 1, 2, and 3. These should be review, but if you are really rusty on your Java, you will want to read these more carefully to help answer the questions. Note that we will revisit some of these topics later, so if you don't understand something completely at this point, it's OK.)  In general, you should make sure you've done the reading for the past week.
  4. Do the following written problems. Please bring hardcopy to class to hand in Monday. They must be neat (either typed or handwritten neatly), and printed and stapled by the beginning of class.
    1. How many classes are in the JavaEyes project?
    2. How many methods does the AnimatedPanel class in JavaEyes have?
    3. How many constructors does the AnimatedPanel class have?
    4. How many fields does the AnimatedPanel class have?
    5. How does Eclipse let you determine all of the above answers quickly, without looking at the actual code?
    6. How would the design of JavaEyes have to change if we were to add an eye that moves independently of the others? For instance, perhaps it continually rolls around clockwise. For this written part, concentrate on how the class structure should change, not the exact implementation of the rolling eye. (You'll implement it as well, as it says in the JavaEyes specification, but your code itself will be turned in via Subclipse, not written out here.)
    7. What is the value of each variable after running the following block of code?
      int x = 0, y = 0, z = 10;
      while (x < z) {
      	y = y + x;
      	if (y > 10) {
      		y = y / 2;
      	}
      	x++;
      }
      
    8. Rewrite the above segment of code using a for statement.
    9. Do Weiss 1.14. Hint: pay careful attention to call-by-value in section 1.6.
    10. Consider the Date class on p. 71 of Weiss.
      1. What date is created by the expression "new Date()". Explain.
      2. Write a method that will advance the year by 1
      3. Fill in the body of the following javadoc'd compareTo() method:
        /**
         * Compares this object with the Date on the right-hand side. 
         * 
         * @param rhs (right-hand-side) The object with which to compare this Date.  
         * @return -1 if this Date comes before rhs, 1 is this Date comes after rhs, 
         * and 0 is they are equal. 
         */
        public int compareTo(Object rhs) {