There is a bad mistake in the Question 6 of the exam!
The example shown in incorrect. The result should be:
> (define p (mlist 1 2 3 4 5)) > (make-cumulative! p) > p {1 3 6 10 15}
The value of each element in the result should be the sum of all elements in the original list up to and including that element. So, the first element in the output list is 1 = 1, the second is 1 + 2 = 3, the third is 1 + 2 + 3 = 6, the fourth is 1 + 2 + 3 + 4 = 10, and the fifth is 1 + 2 + 3 + 4 + 5 = 15.
Sorry for the confusion on this. You will receive full credit for this question if your answer either solves the problem as corrected here, or produces the same outputs as the example shown in the original exam.
Special thanks to Caroline Mattey for reporting the problem.
Aha. I thought it was weird, but at the end I figured that cumulative sum must be the sum of all previous sums, and the next element… :-)
Also, are there any “optional, ungraded questions” at the end of this exam? The cover sheet mentions them, but I don’t see any in the PDF or my hard copy.
No, there aren’t. Sorry, I forgot to remove that from the cover sheet. You should, of course, feel free to add your own questions and/or comments if you think that would be helpful.