Prof. Tak Auyeung
You, as an individual, are expected to do your own work. This means you cannot seek, receive or otherwise acquire any assistance except clarifications from the professor during an examination. Any communication involving the contents of the subject matter or the examination is considered cheating. Do not initiate or accept such communication, or the result of your examination is automatically voided.
New rules, read this! As of 2003.09.22, I no longer deduct points for wrong answers. Each correct answer is worth one point, each wrong answer is worth zero point, and each unanswered question is also worth zero point. This means you should guess and leave no question unanswered.
As a result, I also need to adjust the letter grade assignment break points. For your individual examinuation, ``A'' means at least 90%, ``B'' means at least 70%, ``C'' means at least 50%, ``D'' means at least 30% and ``F'' means below 30%. The break points for the final grade are now 24.16%, 45.83%, 67.50% and 89.16% as minimums for ``D'', ``C'', ``B'' nad ``A'', respectively.
Please note that this change does not affect your letter grade at all, it is just a number game to make some people feel better about guessing.
Make sure you write down you name on the upper right corner first, otherwise I cannot give points to anonymous students!
The baseline is XX, there are YY questions.
X mod Y? Assume X and Y are both
positive.
X div Y
Y div X
(X div Y) * Y
X - ((X div Y) * Y)
Y - ((X div Y) * X)
Z := Y;
while W > 0 do
begin
W := W - 1;
Z := Z + X
end;
writeln(Z)
W * X + Y
W + X * Y
W * Y + X
X * Y * W
Y
Y := 1; while Y < X do Y := Y + Y; writeln(Y)
var
x, y : integer;
procedure p1;
begin
x := x + y
end;
procedure p2;
begin
y := x * 2
end;
begin
x := 20;
y := 2;
p2;
p1;
p1;
writeln(x,',',y)
end.
X := 1; while X < 20 do writeln(X); X := X + 1
if (X < Y) and (X < Z) then
writeln('case 1');
if (Y < X) and (Y < Z) then
writeln('case 2');
if (Z < X) and (Z < Y) then
writeln('case 3')
case 1 case 3
X := 0;
Y := 0;
while X < 5 do
begin
X := X + Y;
Y := Y + 1
end;
writeln(X)
var
j : integer;
begin
j := 0;
while j < 4 do
begin
write((2 + j * 3) mod 4, ' ');
j := j + 1
end;
end.
if X < 0 then block1 else block2
if X >= 0 then block2 else block1
if X < 0 then block1; if X >= 0 then block2
if X >= 0 then block2; if X >= 0 then block1
if X < 0 then
block1
else
if X >= 0 then
block2