



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
The fall 2003 cs61b quiz (midterm) for a computer science course. It includes grading standards and answers for each question, as well as common errors and exceptions. The quiz covers topics such as constructors, mutable objects, and recursion.
Typology: Exams
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Fall 2003 CS61B Quiz (Midterm) (25/300 points)
;;;; Meta ;;;;
GS = Grading Standard
We've tried to include the common errors and grading standard for every question.
;;;;;;;;;; QUESTION 1 ;;;;;;;;;;
GS: Each question clump tested one idea and was worth 1 full point. This worked out to roughly two blanks per clump. You started the question with 7 full points. Any question wrong in a clump lost the entire clump's points (we write "-1" on your exam). If you missed both questions in a clump, it was scored the same as if you missed just one. The exceptions to the two-blanks-per-clump were AB (one clump), E (three clumps) and F (three blanks for one clump).
If you had quotes in your output, you lost 1/2 point -- this was only deducted once on the entire page. If you've already lost the point for a clump, we stopped grading (and ignored your extra quotes).
Common errors -- Very few people had every blank correct. Most missed some trivial errors here and there, pretty much spread across every question. Most common error: almost one-third of the class lost clump #7 (f), putting either 10, B or 100 (or all three). About 20 people missed clump #1.
clump #
a) 1 b) one
clump #
c) CD 61CDEF
clump #
d) 25 610
clump #4,5,6 (-1 per wrong answer here)
e) false true false false true R-ERROR
clump #
f) 9 A 105
a) GS: 3 pts Start with 3, -1/2 for each incorrect line (min 0)
(1) AD ADE (2) BD BE E (3) E (4) BE B (5) E (6) C CD BC BCD
2 elements each iteration of the loop, but this isn't the case. Only the call to e.nextElement() in the increment part of the for loop is called during each iteration.
public int familyFortune() { if (myParent == null) return(myBalance); else return(myBalance + myParent.familyFortune()); }
me.familyFortune());
public static int familyFortuneStatic(Account a) { if (a == null) return(0); else return(a.myBalance + familyFortuneStatic(a.myParent)); }
Account.familyFortuneStatic(me);
Grading Standards:
Starting with 10 points, scores were determined by deducting up to one point per blank (the two blanks around 'me' in both methods were considered one. Both methods were worth up to five points, even tho the second method has six blanks)
Examples:
Examples:
Examples: