(define (eval num code)
(cond
[(number? code) code] ; if its a number, then it is equal to that number
[(symbol? code) num] ; if it is a variable, then it is equal to the number the user gave
[(cons? code) ; it is something like (op ex1 ex2)
(cond
; first case: we add the two arguments. we must evaluate the arguments first.
[(equal? (first code) '+) (+ (eval num (second code)) (eval num (third code)))]
[(equal? (first code) '-) (- (eval num (second code)) (eval num (third code)))]
[(equal? (first code) '/) (/ (eval num (second code)) (eval num (third code)))])]))