Last updated 14 Dec 1998: Please check this page as it may change as the exam approaches.
Much of the exam will be like the mid-term, so refer to that as a
primary reference
Like Problem 0.1 in the mid-term, there will be simple Scheme statements
to be evaluated
In addition to the types of expressions in Problem 0.1 in the mid-term,
expect to see
let set! set-car! set-cdr!
in expressions you will need to evaluate.
You may need to identify what a simple code does, e.g.
(define (whatdoIdo n)
(if (< n 1)
1
(+ (* n n) ((whatdoIdo (- n 1))))))
and describe its behavior by a mathematical expression.
You will probably need to program some more complicated mathematical
expressions in tail-recursive form. For example, program an iterative code that
sums the first n Fibonacci numbers. It should combine the summation
and the computation of the Fibonacci numbers in one recursive procedure.
Expect a question regarding abstract data types.
For example, modify your definition of the color type RGB
so that you can also access the data via the HSV system (Hue, Saturation and
Value). Just assume that there is an external mapping provided to map an
RGB value to an HSV . Make this like the complex number
system that has two different representations, so that you can define something
as either RGB or HSV .
One property of the HSV representation is that changing the
Saturation does not change the "color" in a certain sense.
That is two colors with the same Hue and Value look compatible.
Create a mutator for colors that changes only the saturation value.