CS140 Midterm 1 Grading Guide
Written Exam
- (12 points) 2 points for each part. All or nothing.
- (10 points) It's roughly 2 points for each part. Mark
what is wrong but assign a single grade, rather than 5 separate grades
for each part. That way if you think one part should be a half point
deduction and another part should be a 1.5 point deduction, you can
combine them into a single 2 point deduction.
- (8 points) 2 points for part a, 6 points for the
student's argument in part b.
- all or nothing.
- The answer needs to state that constructor (b) with the
initialiation lists only requires
one constructor call per string variable while the constructor with the assignment statements (the
(a) constructor) requires both a 0-argument constructor call and
an assignment operation for each string variable. If the student only gives half the argument,
such as saying why constructor (b) is efficient without saying why
constructor (a) is inefficient, then give 3 points.
- (12 points): 4 points per part
- 4 points: use your judgement to assign partial credit
- 4 points: the critical idea is that the shifting is
starting from the left side or front of the vector rather than from
the right side or back of the vector. If they make this point in some
form, give full credit. They can get partial credit, 2 points,
for saying that parts of the original vector are getting
clobbered. That observation should be obvious from the diagram. I
also want them to get the higher level idea that this problem
is caused by starting the shifting from the wrong side of
the vector.
- 4 points: They need to modify fragment 2. If they modify
another fragment without modifying fragment 2, it's 0 points.
If they modify fragment 2 and another fragment, deduct 1-2
points depending on how egregious the modification to the
other fragment(s) is. If they only modify fragment 2 but
get some part wrong, use your judgement to assign partial
credit.
- (24 points) 1 point for each key in each of the three
tables (the separate chaining table in part a is worth 8 points, the
quadratic probing table in part a is worth 8 points, and the
quadratic probing table in part b is worth 8 points). In part b,
give partial credit if they get something wrong early and a
subsequent key would be correctly placed based on their earlier
misplacement. For example, if they put key 12 in location 2
rather than location 1, then the proper location for key 30 is
location 1. If they do that, then key 30 should be counted
correct.
- (12 points) 3 points for each part.
- For part a give 2 points if one of the two binary "blocks"
is correct and the other is incorrect.
- For parts b-d students
can get 2 points for giving the binary representation of the answer
rather than the hexadecimal representation. If the student provides
an incorrect hexadecimal answer, convert the answer to binary and give 2 points if 1 digit is wrong, 1 point if 2 digits are wrong, and 0 otherwise . If the student provides an incorrect binary answer, give 1 point if 1 or 2 digits are wrong and 0 otherwise.
- (5 points) Use your judgement in assigning partial credit.
For example, if they forget the "+1", I would deduct a single point.
The subtraction operation of 'a' from animal is the key part of this
problem and worth 3-4 points.
- (10 points) Things to check in the formatting string:
- (2 points) The name should be 15 spaces wide (%15s) and
- (1 point) The name must be printed using the .c_str()
function
- (4 points) Salary is printed in a left-justified field of 12 characters with 1 decimal digit (%-12.1f)
- (2 points) Age should be left justified in a field
6 spaces wide (%-6d). However, don't count off twice for failing to
left justify both fields. If they answered %12.1f for salary and
%6d for age, then just deduct once for failing to left justify.
- (1 point) Your judgement
- (12 points)
- 3 points for printing the strings in the correct order
- 3 points for a correct integer total
- 3 points for a correct floating point total
- 1 point for printing everything in the correct order (strings,
then integer total, then floating point total)
- 2 points: your judgement
Coding
- tail (20 points)
- (5 points) handles the command line argument for number of lines to print
correctly
- (5 points) correctly reads lines from stdin and stores them in a vector
- (5 points) computes the correct index in the vector from which to start
printing
- (5 points) correctly prints the last n lines of the file
- teams (25 points)
- readTeams (10 points)
- (5 points) use an istringstream to break the group string into team
members
- (3 points) push each team member into either a temporary row vector or
else into the new row you've already created in team
- (2 points) create a new row in team, either using resize or by pushing
a temporary row vector onto team
- printTeams (15 points)
- (6 points) find the index of the team leader
- (7 points) print the team if found
- (1 point) fields should be 10 characters wide
- (1 point) use .c_str() to print the string
- (3 points) print in rows with 3 columns
- (1 point) put newline after last row
- (1 point) put extra newline after last row
- (2 points) if the team is not found, print the designated error message