 
Summary: CS4700 Homework #6
Note, these exercises may be done in groups of one, two, or three.
1) In a switch statement, would a standard jump table be an appropriate implementation
for the following distribution of case constants? If not, explain an alternative you
would consider.
a) Twenty cases close together in value (say a range of 50)
b) A thousand cases close together in value (say a range of 1050)
c) Five cases over a wide range of values (say a range of 1000).
d) A thousand cases over a wide range of values (say a range of 1,000,000).
2) Order of evaluation. While precedence and association controls the parse tree that is
formed, the order of evaluation within the tree might not be specified by the language
design. If there are no sideeffects, the order of expression evaluation doesn't matter,
but with side effects, the results are different depending on the expression evaluation
order. What possible values for sum could result?
function Doit( var K: integer) : integer // K is passed by reference
begin
K :=K*4;
return K;
end;
i := 5;
