CS 1713 Introduction to Computer Science, Fall 2005 Project 2 Comments

  1. No source code lines should be longer than 80 columns.
  2. Input should always be validated. If you are reading in a length it should be greater than 0. Otherwise it should not be used to create a room.
  3. Test for possible division by 0.
  4. In testing Strings for equality, use the equals method.
    This is preferable to using compareTo.
    Do not use ==.
  5. House should call getArea of Room rather than calculating the area from the width and length.
  6. addRoom should not let you add a room if the array is full.
  7. Don't make a new copy of the Scanner class each time you want to do input.
  8. Comments should be useful. e.g. if the code is
    count = -1;
    The comment: "set count to -1" is not useful.
    It would be better to explain why you are setting the count to -1.
A zip file of a completed project can be found here.