(Latest Revision: 04/05/2002 )
prog_2_ResultsByCode
prog_2_ResultsByCode
This file shows grades on program #2, along with indications of
the problems and point deductions.
Find your code number below.
Look at the the codes, scores, and comments below your code
number.
Next see the "Legend" near the bottom of the page to determine
the meaning of the codes.
See me if you have any questions, if you find an error, or if you
want further explanation of your grade.
0197: - G02(-20) G08(-1) G17(-2) S01(-2) S02(-2)
- 100-20-1-2-2-2==73==C
- G08: Function "swap" should be void
- G17: No multi-line outputs were tried.
0570: - G01(-10) G08(-1) G11() G13(-2) S01(-2) S02(-2)
- 100-10-1-2-2-2 == 83 == B
- G08: function swap should be void.
- G11: In the header comment to function "sort" tell the meanings of each of the three input parameters "list," "firstIndex," and "lastIndex." Explain what you mean by "Puts data in a sorted output" -- i.e. "list[i] <= list[j] when i<=j and firstIndex <= i,j <= lastIndex" OR "the portion of the array "list" between index firstIndex and index lastIndex (inclusive) is sorted into ascending order."
- G13: See code in function "printResults"
2305: - G08(-1) G14(-3) G11() S03(-5)
- 100-1-3-5 == 91 == A
- G11: In the header comment to function "sortInput" tell the meanings of each of the three input parameters "list," "firstIdx," and "lastIdx." Explain what you mean by "sorted data" -- i.e. "list[i] <= list[j] when i<=j and firstIdx <= i,j <= lastIdx" OR "the portion of the array "list" between index firstIdx and index lastIdx (inclusive) is sorted into ascending order."
- G08: function "swap" should be void
2727: - G11() G13(-2) G14(-3) S02(-2)
- 100-2-3-2 == 93 == A
- G11: One example: the header of function "sort" does not describe any output. "Output" is what the function does. Are you claiming that "sort" does nothing? The header gives no clue of what the function does. The most basic and essential purpose of a header is to tell what the function does. There is good information in the first sentence of the "INPUT" section. However, the second sentence seems to be a try to tell *how* the function works. Usually, the header should not tell *how* the function does what it does. The header should be mainly about *what* the function does.
7015: - G08(-1) G11(-1)
- 100-1-1==98==A
- G08: Function "printlist" should be void
- G11: In the header of a function F, describe only what F does, not what the caller of F does.
7169: - G11() G14(-3)
- 100-3 == 97 == A
- G11: One example: the header of function "sort" does not describe the output. "Output" is what the function does. Are you claiming that "sort" does nothing? The header gives no clue of what the function does. The most basic and essential purpose of a header is to tell what the function does.
- G14: Check function "swap"
7422: - G09(-2) G11() G17(-4)
- 100-2-4 == 94 == A
- G09: "array" is a very vague name. "GetInput," for example, would be a much better name for this function. There is also a problem with the name of function "sort." The problem with "sort" cannot be fixed by changing the name. The function performs two different tasks. One task is the sorting of the list of numbers. The other task is the writing of the sorted data to the standard output. It would be much better to make two separate functions -- one to sort and one to write the list.
- G11: The header comment of "sort" does not give enough information. What is the meaning of the inputs?
- G17: You should test an empty list, one of size one, and one of size two.
7883: - G08() G14(-3) S04(-10)
- 100-3-10 == 87 == B
- S04: I see a line with 21 numbers on it, and then the rest of the lines have just one number per line.
- G08: "Loc" is handled in a redundant fashion by function "minloc." Return Loc as the value of the function, or return it by modifying a reference parameter. Don't do both.
8786: - G03(-2) G13(-5) G14(-3)
- 100-2-5-3 == 90 == B
- G13: you should indent at least two spaces from the "{" and "}"
8885: - G06() G08() G11()
- 100-0 == 100 == A
- G06: Since list is passed as a parameter from function to function, it should be declared local to funtion "main."
- G08: main should be an int function that returns 0.
- G11: For example in function "sort" you should describe the meanings of the inputs "list," "first," "last," and "loc."
8991: - G01(-10) G11()
- 100-10 == 90 == B
- G11: Your header of function "sort" does not tell what the function does. It claimes that there is no input, and that a message is the only output. The list, and the start and finish indices are inputs. The list is an output too. The function changes "list." It sorts the elements of the list from index firstIndex to index lastIndex into ascending order. It is essential that header comments of functions explain *what* the function does.
9317: - G08(-1) G11() G14(-3) S02(-2)
- 100-1-3-2 == 94 == A
- G08: function minloc is "int", but does not have a return statement. Also, it would be better to declare the index variable i before the start of the for-loop.
- G11: One example: the header of function "sort" does not describe the output. "Output" is what the function does. Are you claiming that "sort" does nothing? The header gives no clue of what the function does. The most basic and essential purpose of a header is to tell what the function does.
-
9755: - G01(-10) G11() G13() G17(-4) S02(-2) S05() S06(-5) S07(-10)
- 100-10-4-2-5-10 == 69 == D
- G01: program was actually 7 days late -- (problem doing e-mail)
- G11: Consider the header to function "selectionSort." It discusses *how* the function works. It should not do that. On the other hand, it does not tell *what* the function does. It should tell *what* the function does -- that is the most basic and essential job of the header comment.
- G13: The "{" and matching "}" should be at the same level of indentation.
- G17: You should test an empty list, one of size one, and one of size two.
======================================================
Legend
======================================================
Generic Types of Problems
--------------------------
G01. Program was late (Due 03/19) (-10 pts per day)
G02. Program was too late to be accepted (-100 pts)
G03. The correct subject line was not used. (-2 each message)
"CS2500P2Source" and "CS2500P2Script"
G04. Program does not compile (up to -100 points)
G05. The program does not use functions appropriately. (-10)
G06. The program uses a global variable inappropriately (-5)
G07. The program does not make proper use of parameters. (up to -20)
G08. The program does not make proper use of return values. (up to -10)
(-1 for each function that should be void but is not)
(-3 for each function that fails to return a value and thus
creates a logical error)
(-1 each for extra return statements in functions)
G09. Function or variable does not have a mnemonic name (-2 each)
G10. Header comment before main program missing. (-3)
G11. Header comments before functions missing or have the wrong
kind of content. (up to -5)
G12. There are no header comments (or almost none). (-10)
G13. Code is not indented properly (For each line that is not
indented from its enclosing brace by two or more spaces, -1
point, up to a max of -5. A point is taken off also when
there are two lines that should have the same level of
indentation, but do not. The "{" and matching "}" should be
at the same level of indentation.)
G14. Program and output does not fit into a field width of 78
characters. (this tends to make it harder to check and
test -- and print too.) (-3)
G15. No test script was received. (-15)
G16. Script does not evince an effort to achieve good code
coverage. (up to -10)
G17. Script does not evince an effort to cover boundary values
adequately. (up to -4)
======================================================
Assignment-Specific Problems
--------------------------
S01. The program puts one too few numbers on output line(s). (-2)
S02. The program claims to process one more array location than it should.(-2)
S03. There is one number out of place in the "sorted" output. (-5)
S04. The format of the output is "radically" wrong. (-10)
S05. The program does not handle it if there is whitespace
at the start of the input file. (up to -2)
S06. The program does not put a tab character between successive
numbers on the same line (-5)
S07. The program appears to read only the first line of input. (-10)
======================================================