CSE 240 Final Exam Review ACTUAL UPDATED QUESTIONS AND CORRECT
ANSWERS
, Functional programming languages do NOT allow us to variables whose value can be modified.
define:
The statement "a function is a first-class object" means can be placed in a place where a value is expected.
that a function
What notation requires parentheses in order to correctly infix notation
define the order of computation?
Convert the following expression into prefix-p notation (a (+ (* (- 5) (+ 2 (/ 1 2))) 40)
Scheme statement):
-5 * (2 + 1/2) + 40
One of the major differences between the imperative and have side-effects.
functional programming languages is that the functional
programming languages do NOT (in general!)...
Which of the following is a valid Scheme expression? (* 9 (/ (- 4 2) 7))
Convert the following expression into prefix-p notation (a (+ 10 (- 5 3) (/ 2 4))
Scheme statement):
10 + (5 - 3) +
Given an expression: x1 + x2 + x3 + x4 Scheme
Which language allows us to evaluate the expression in
this order: (1) x1 plus x2; (2) x3 plus x4; (3) sum of ( x1 + x2
) plus sum of ( x3 + x4 ), without concern for producing a
different result than other evaluation orders:
What is the expected result for this expression (in #\o
Scheme)?
(string-ref "Hello World" 4)
Which of the following expression will return false (#f)? (number? #\7)
Given this procedure, what is the return result? "I'm a number"
(define (guess value)
(cond ((number? value) "I'm a number")
((char? value) "I'm a character")
((integer? value) "I'm a integer")))
(guess 10)
Which of the following are typical advantages of using a They let you interact with a program after it has populated the environment to
REPL for software development? understand what is happening.
They let you experiment with small pieces of code to understand how they work.
ANSWERS
, Functional programming languages do NOT allow us to variables whose value can be modified.
define:
The statement "a function is a first-class object" means can be placed in a place where a value is expected.
that a function
What notation requires parentheses in order to correctly infix notation
define the order of computation?
Convert the following expression into prefix-p notation (a (+ (* (- 5) (+ 2 (/ 1 2))) 40)
Scheme statement):
-5 * (2 + 1/2) + 40
One of the major differences between the imperative and have side-effects.
functional programming languages is that the functional
programming languages do NOT (in general!)...
Which of the following is a valid Scheme expression? (* 9 (/ (- 4 2) 7))
Convert the following expression into prefix-p notation (a (+ 10 (- 5 3) (/ 2 4))
Scheme statement):
10 + (5 - 3) +
Given an expression: x1 + x2 + x3 + x4 Scheme
Which language allows us to evaluate the expression in
this order: (1) x1 plus x2; (2) x3 plus x4; (3) sum of ( x1 + x2
) plus sum of ( x3 + x4 ), without concern for producing a
different result than other evaluation orders:
What is the expected result for this expression (in #\o
Scheme)?
(string-ref "Hello World" 4)
Which of the following expression will return false (#f)? (number? #\7)
Given this procedure, what is the return result? "I'm a number"
(define (guess value)
(cond ((number? value) "I'm a number")
((char? value) "I'm a character")
((integer? value) "I'm a integer")))
(guess 10)
Which of the following are typical advantages of using a They let you interact with a program after it has populated the environment to
REPL for software development? understand what is happening.
They let you experiment with small pieces of code to understand how they work.