Professional Documents
Culture Documents
T
w
o
H
ACSL
Contest #1
Contest 1 Topics
Intermediate:
Computer Number Systems - two bases - 2
Recursive Functions - Not nested - 2
What Does This Program Do? - Branching - 1
Senior:
Computer Number Systems - multiple bases - 2
Recursive Functions - Nested - 2
What Does This Program Do? - Branching and Loops - 1
CNS-Base to Decimal
CNS-Decimal to Base
0
0
0
0
0
0
0
0
1
1
1
0
0
0
0
0
0
0
1
0
1
1
0
0
0
0
0
0
1
1
1
0
1
0
0
0
0
0
1
1
1
0
0
1
0
0
0
0
1
1
1
0
0
1
1
0
0
0
0
1
0
0
1
0
0
1
0
0
1
1
1
1
0
0
0
0
1
0
1
0
1
1
1
0
1
0
0
1
To convert from base to base, you can convert the first number to decimal and then
convert the decimal number to the second base.
To go straight from binary to hexadecimal, break up the binary in chunks of four digits and
convert each chunk into decimal. So break up 1001010000112 as 1001 0100 00112 and
convert each chunk to decimal to get 94316.
To convert hexadecimal to binary, represent each digit in binary. So 72516 would equal
0111001001012
To convert binary to octal is a similar process. Break up the binary number into chunks of
three digits. Example: 1101001001 becomes 001 101 001 001. This becomes 15118. The
same process works in reverse: 73328 becomes 111 011 011 010
Recursive Functions
Recursive Functions
1.
2.
3.
4.
5.
6.
7.
8.
9.
Recursive Functions
Senior division topics:
Nested recursion:
f(f(f(54)))
Multiple variables: (2014 contest)