|
|
|
These are the instructions given to the graders when they graded Quiz 2.
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.
Sample Output
There was one test case run, with the input being 20. The output
should be a list of the numbers from 3 to 20, with each number having
"prime" or "composite" after it, as appropriate.
Prime number listing
Enter max number: 20
2 prime
3 prime
4 composite
5 prime
6 composite
7 prime
8 composite
9 composite
10 composite
11 prime
12 composite
13 prime
14 composite
15 composite
16 composite
17 prime
18 composite
19 prime
20 composite
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
They need to have a valid prompt, and read it via a Scanner method
.
Program steps
If they commented something out and it would have worked, they get 2/3
points for that part (round normally -- 0.5 and above rounds up). If they commented something out and it had bugs
in it, they get 1/3 points for that part (round normally again). And if they got it
more-or-less correct, but had some errors, then half credit for that
section.
- 20 points: Proper nested loop structure
They should have two
nested loops -- one to run from 2 to n, and one to compute all the
divisors.
- Outer loop
- -10 if missing
- -2 if they print 1
- -2 if they print 0 (in addition to the penalty on the previous line)
- -2 if they do not print that 20 is composite
- -2 if they do not print that 2 is prime
- -5 if the loop bounds are incorrect
- Inner loop
- -10 if missing
- -5 if the loop bounds are incorrect
- 20 points: Proper testing (and printing) of composite numbers
Testing - 15 pts; Printing - 5 pts
- -5 if they were close to the right answer
- -10 if they had the right idea or at least made a strong effort
- -15 if they had no idea how to test (or did not test at all)
- -5 if printing is bad (e.g. incorrect output, but correct logic); do not
take these points off if the printing could have been correct better logic
- 20 points: Proper testing (and printing) of prime numbers
This part is a bit harder than composite numbers. Testing - 15
pts; Printing - 5 pts
- -5 if they were close to the right answer
- -10 if they had the right idea or at least made a strong effort
- -15 if they had no idea how to test (or did not test at all)
- -5 if printing is bad (e.g. incorrect output, but correct logic); do not
take these points off if the printing could have been correct better logic
|
|