Prob 1: Many people divided by 10 rather than by 10.0. Since an "average" is rarely an integer, one needs to divide by a float in order to get a float as an answer.
Prob 2: Some people divided by the conversion factor, or put TOTINCHES on the right of the assignment rather than the left.
Prob 4: Some people did not remember the class discussion on this topic (cf. Notes N22). A few, for some reason, reversed the order of the assignment (the left side became the right and vice versa).
Prob 6: The last part was to create an "assignment" statement, i.e., one with an equals sign in it, which is the "equivalent" of the sequence of operations. The order of the variable should have been the same (except for the D at the end). There should not have been values included in the final expression.
Prob 10:
Some people tried (ingeniously) to reverse the "function" of first
and last. Using this startup, the sample version of binary search
given in class will work.
What I intended was that one would keep "first" as the initial
pointer to the lower end of the array and "last" as the pointer
to the end and modify the other statements.
Some people ignored the necessity of shifting last and first by
one (i.e., of using middle-1 or middle+1).
Prob 12: The iterative version (first code) should have an explicit loop in it (the for loop is the easiest to use) and no function call to itself.
The recursive version (second code) should have NO loop and an explicit call to the same function. Recursive routines must have some way of stopping, usually corresponding to "base" case of the function (in this case, most correct codes returned a value of 1 if the input was 1).
Prob 14: This was basically a problem in seeing if people understood truth table logic and the use of nested if statements.
Prob 15: Overloading functions names -- see Notes N21. Templates deal with an interdeterminate variable datatype when defining a class or a function. The datatype is determined when the class or function is actually used. (Notes N23)
const variable parameter modifiers -- see Notes M1.
inheritance -- see Notes N14.
Prob 16: Some people seemed to reverse the meaning of value and variable parameters. Some people had the same answers for both sections of the problem.
final nfinal
189 87
180 78
176 74
171 70
169 68
168 67
166 65
163 62
162 61
158 57
155 54
155 54
154 53
153 52
150 49
149 48
149 48
149 48
148 48
146 46
143 43
142 42
140 40
139 39
136 36
134 34
132 32
126 26
125 25
122 22
119 20
MAXIMUM 200 100
x
x
x x
x x x
x x x x
x x x x x
x x x x x x x
x x x x x x x x
110 120 130 140 150 160 170 180
This page is maintained by Dennis C. Smolarski, S.J.
dsmolarski@math.scu.edu
© Copyright 1998 Dennis C. Smolarski, SJ, All rights reserved.
Last changed: 21 March 1999.