COMPLETE SOLUTIONS VERIFIED
In scheme, the form(symbol-length? 'James) will return:
a. an error message
b. 5
c. 0
d. 7
e. 6
a
Functional programming languages do NOT allow us to define
a. procedures
b. multiple parameters in one procedure
c. variables whose value can be modified
d. named values
c
convert the following expression into prefix-p notation
-5 * (2 + 1/2) + 40
a. (+(*(-5)(+ 2(/ 1 2)))40)
b.(-5 *(2+1/2)+40)
,c. (* (+(-5)(/2 (+1 2)))40)
d.+*-5+2/1 2 40
a
convert following exp into pre-fix p
10 + (5-3) +
a. + 10 - 5 4
b. (/ (+ 10(- 5 3)2)4)
c. (+10 (-5 3)(/2 4))
d. 10 + (5-3) + 2/4
c
which of the following is a valid scheme expression?
a. 9 *(4 -2)/7
b. *9(/(- 4 2)7)
c. (* 9(/ (- 4 2)7))
d. *9 / -4 2 7
c
one of the major difference between imperative and functional programming
languages is that the functional programming languages do NOT
a. support call-by-calue parameter passing
b. allow nested function calls
, c. allow a procedure to return a value
d. have side-effects
d
the statement "a function is a first-class object" means that a function
a. must have a return value
b. must be instantiated from a class
c. can be placed in a place where a value is expected
d. may not have side effects
c
given this procedure, what is the return result?
(define (guess value)
(cond ((number? value)"I'm a number")
((char?value)"I'm a characted")
((interger?value)"I'm a integer")))
(guess 10)
a. "i'm a character"
b.error
c."I'm a integer"
c."I'm a number"
d