|
|
|
These are the instructions given to the graders when they graded Quiz 1.
If the program does not compile and/or not run, you need to look at the code,
and manually trace it to find out why. Don't take points off if it doesn't
compile, though -- the system does that automatically. There are two
test cases that were run. The data provided (and the output expected) are
below.
- The first output: the rates in min/km are 1, 2, and 3 (for the swim,
bike, and run)
- The second output: the rates in min/mile are 1, 2, and 3 (for the swim,
bike, and run)
- The third output: the Ironman parts take 1, 2, and 3 hours (for the
swim, bike, and run), and 6 hours total
Sample Output
The output should be what's listed below -- there are two execution runs.
Obviously, there is the legend and input prompts as well, which is not shown
here. And they may have more text listed there (such as "the substring
is bar") -- that's fine.
Execution 1: input provided was: 3 6 foobarbaz
bar
4
7
FOOBARBAZ
9
short Execution 2: input provided was: 6 12 reallyreallybigstringreally
2
8
REALLYREALLYBIGSTRING
21
long
Programming style
- 10 points: Program header (includes name, e-mail ID, and purpose)
If a major structure is missing (such as the main() method), then points
are taken off here
- -5 if 1 is missing
- -10 if 2 or more are missing
- -10 if the class line is wrong (or the main() method prototype is wrong)
- 10 points: Good commenting and use of whitespace
Each "block" of code (a "block" is one or two lines
of code) should be separated by a blank line, and have a line of commenting
above it.
- -5 for excessively long lines in code
- -5 for excessive whitespace (more than 2-3 lines)
- -2 for each misleading comments
- -5 for bad indentation
Input and output
- 10 points: Input: Proper Scanner creation; proper usage for obtaining
input
...
- -10 if they obtain the input in the wrong order, but grade the rest of
the quiz as if the input was provided in the order they desired
- -3 if they declare multiple Scanner objects (program will encounter a
run-time exception if this occurs)
- -10 if they use BufferedReader and
InputStream instead of Scanner
- -10 if they use Scanner.create() rather than new Scanner()
- -5 if they use nextLine() instead of next()
- 10 points: Output: prints an appropriate legend; properly echoes
input
They need to have a valid prompt, and read it via a Scanner method
.
- -5 for not echoing input
- -5 for no legend
Program steps
If they commented something out and it would have worked, they get 7
points for that part. If they commented something out and it had bugs
in it, they get 3 points for that part. And if they got it
more-or-less correct, but had some errors, then half credit for that
section.
- 10 points: Step 1: Proper substring() usage
...
- -3 points if they do substring to j-1 rather than j
- 15 points: Steps 2 and 3: Proper indexOf() / lastIndexOf() usage
...
- 10 points: Step 4: Proper toUpperCase() usage
...
- 10 points: Step 5: Proper length() usage
...
- 15 points: Step 6: Proper if-else usage for 'short'/'long'
They are allowed to use two separate if statements (and no if-else).
They can also use the ?: notation for full credit on this part
|
|