Name: Elizabeth Adams
Assignment: Lab 1 – changes made to code with reasons
Date: January 17, 2005
Course: CS 239
Blue
items are Adams rules
Red
items a strongly suggested guidelines – except where truly imappropriate
- Removed
the BREAK statement (Design B.2)
- changed
the method names to use lowercase except for the first letter of each word
other than the first word (Style B.3)
- Fixed
indentation (Style C.1, C.2, C.3)
- Variables
should be declared at the top of a method – START isn’t
- Shouldn’t
declare and initialize in the same statement - BufferedReader stdin
- START
isn’t a constant so it should be in lower case (Style B.3)
- Should
give user range of numbers that are valid first (Style E.4)
7a. Should provide user with range of numbers.
- Moved
the methods that printed the verse to another class because shouldn’t have
other methods in same class as main (Design C.1)
- It would be nice to tell the user what the program will
do (i.e. provide an intro)
- Verse
should not be capitalized. It is a
variable not a class (Style B.2)
- Added
header documentation (Documentation C.2)
- Added
comments (Documentation D.1, D.2)
- changed
variable name START to numberOfBottles (Style A.1, A.2, B.3)
- The input to your program should be echoed back to the
user
- Spelling and
grammar count
- Every
class and method needs a javadocs comment which includes a description,
the parameters (if any) and the return information (if any)
- Lines
of code should be short enough so that wrap-around doesn’t occur on
printout
- We
will not use the Keyboard class this semester
- Don’t
use the tab key for indentation – use the space bar
- You should have used if (
) else if ( )
else if ( ) in this
assignment and the order of the test conditions matters
- Don’t
put too much code in main method
- This
could cause a logic problem when your program runs
- Header
comments need to be in javadocs format
- I
prefer that your methods return a single value or variable – don’t have a
computation in the return statement.
Don’t initialize variables that don’t need to be initialized.
- Curly
braces need to be on lines by themselves and need to have matched
indentation.