University of Toronto - Fall 2001
Department of Computer Science

Assignment 2 Announcements

September 26: Sample Output

Question: Could you please provide me with sample output for TestHouse.java ?
Answer: No. We have intentionally not provided the sample output. Students sometimes misunderstand that it is possible to have the correct output for TestHouse.java and yet still have errors in House.java. You will need to determine what the output should be for TestHouse.java and also for any other collection of calls to House.java.

September 22: Funny Output

Question:
In TestHouse.java the statement:
        System.out.println(
            "The asking price of this house:\n"
            + h1 +"\nis $"+h1.getPrice());

actually prints the price two times. Once from the toString method of h1 and once in the getPrice() method. Is that what you wanted?
Answer: Yes, the same price should be printed twice in that statement.

September 22: Asking Price?

Question:Is an asking price of a house the same as a list price?
Answer: Yes, asking price and list price are two terms for the same thing.
Question: The handout suggests that I need only one instance variable to store a price of the house. Am I reading that correctly?
Answer: Yes.

September 18, 2001 Comment Corrected

Question: TestHouse.java doesn't seem consistent. It contains the comment:
        // increase the asking price of h1 by $15000
but the next line of code calls a method on h2 not h1. Is that a mistake?
Answer: Yes, we've changed the comment to refer to h2 now. Notice that it is an error in the comment not the code so with either version of the file, your program should have the same output.

September 17, 2001 Irrelevant Instance Variables

Question: When the status of a house is unlisted the price and buyer for the house are irrelevant. Does that mean that I'm somehow supposed to have instance variables that only exist based on the value of another instance variable?
Answer: No. The instance variables which store the price and buyer might still have values but the values stored in them are meaningless when the house is unlisted. Have a look at the toString() method which only prints out the relevant properties of the object.