ACSL

American Computer Science League


Recursive Functions

 

Find(12) given the following:

 


Computer Number Systems

 

Which of the following 5 numbers is the largest?  F116,  3758,  10F16,  26410,  111110002


Prefix/Infix/Postfix

 

Evaluate the following postfix expression if a = 3, b = -2, and c = 5

 

a b c / b ^ a c 2 a * 3 b * * +


LISP

 

Evaluate the following LISP expression:

 

(ADD(MULT 3 (EXP 2 3))(MULT(EXP 2 2)(SUB(MULT 5 3) 6))(EXP 2 (SUB 9 3)))


Boolean Algebra

Simplify the following Boolean expression:


What Does This Program Do?

 

What are the final values of  C and S after the following program is executed?

 

C = 0: S = 0

FOR I = 1 TO 50

IF I/2 = INT(I/2) THEN C = C + 1 ELSE S = S + 1

NEXT I

FOR K = 1 TO 50

IF (K/3 = INT(K/3)) AND (K/2 <> INT(K/2))

THEN C = C + 1 ELSE S = S + 1

NEXT K

FOR J = 1 TO 50 STEP 2

IF (J/5 = INT(J/5)) AND (J/3 <> INT(J/3))

THEN C = C + 1 ELSE S =S + 1

NEXT J

END