American Computer Science League
2001-2002 Contest #1
Junior Division Short Problems
1. Computer Number Systems
Convert 246 from octal to hexadecimal
2. Computer Number Systems
Solve for X16
X16 = BA35816 + AE8BC16
3. What Does This Program Do
After the following program is run, what is the final value of C?
10 C = 0: K = 0: S = 1
20 IF S < 0 THEN C= C 1 ELSE C = C 1
30 K = K 1: S = S
40 IF K 8 THEN GOTO 20
50 END
4. Recursive Functions
Find f (6)
f (x 1)+x if x 4
f (x) = 2x otherwise
5. Recursive Functions
Find f (7,4)
x y if x 0
x f (x 2, y 1) if x 0 and x is even
f (x,y) =
y f ( y 2, x 1) if x 0 and x is odd