You are on page 1of 1

2.

(a)Determine the values of the following


1.Convert the following arithmetic
expressions. Use your Scheme system to
expressions into Scheme expressions
verify your answers.
and evaluate them.

  a. 1.2 × 3 + (2 - 1/3) + -8.7   a. (cons (car '(a b c)) (cdr '(d e f)))
  b. (2/3 + 4/9) ÷ (5/11 - 4/3)   b. (- 1.5 1/2)
  c. 1x1-1 + 1 ÷ (2 + 1 ÷ (1 + 1/2))   c. '((1 2) (3 4)) 

  d. 1 × -2 × 3 × -4 × 5 × -6 × 7x8x-9   d. '(a b c d)

  e. (quote (1 2 3 4 5))
2.(b) (define square
  f. (car (cdr '(a b c)))
(lambda (n)
  g. (quote ("this" "is" "a" "list"))
(* n n)))

Based on above function find the out put of given


expression:
1.(square -200)
2.(square 0.5)
3.(square -1/2)

You might also like