Lesson 4
I wanted to focus the grading comments on stuff that will make a difference when doing your assignment. As such, I didn't check the correctness of your solutions too carefully. I imagine you know if your calculations weren't quite right, and you don't need me to confirm this. If you have any questions about good ways to do calculations of this sort, I'll be happy to answer them on an individual basis
There were a few things that were common mistakes that I want to mention here:
- Initializing "min" as a constructor argument - I think too many people simple copied the
Counter rather than thinking carefully about the requirements of the Time. They were similar, but not identical. For example, Time objects will always have a minimum value of zero. Also, they will typically start at zero. It could be argued that the constructor that allows the user to set current, min and max is handy to have in your Time class (especially for debugging), but the way this class was supposed to be used in this assignment required the user to only construct the object with a maximum value (59 or 60 for seconds and minutes, some other value for hours) --- the current and minimum values could be set to a default of zero. It would have been more appropriate to have several constructors, allowing the user to choose whichever was appropriate for the program; in this case, a constructor with only one argument (max) should have been available.
- Class and file header comments - The requirements for these types of comments are stated very explicity in the commenting guide! Again, correcting this for each source file could take a maximum of 5 minutes per file! There is no excuse for losing points for this type of mistake!!
- Using only 80 columns of text - This can be difficult sometimes, but we take this very seriously! If you're not sure how to manipulate a long line of code so it fits inside of 80 columns (including any tabbing that is necessary!), please ask me! You never have to use more than 80 columns!
Back to Rob's Main Page ...