CS 1713 Introduction to Computer Science, Fall 2005 Project 2 Comments
- No source code lines should be longer than 80 columns.
- 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.
- Test for possible division by 0.
- In testing Strings for equality, use the equals method.
This is preferable to using compareTo.
Do not use ==.
- House should call getArea of Room rather than calculating the area
from the width and length.
- addRoom should not let you add a room if the array is full.
- Don't make a new copy of the Scanner class each time you want to do input.
- 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.