100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached
logo-home
CSE 240 Final Exam with correct answers 2024 $15.49   Add to cart

Exam (elaborations)

CSE 240 Final Exam with correct answers 2024

 2 views  0 purchase
  • Course
  • CSE 240 Fi
  • Institution
  • CSE 240 Fi

Functional programming languages do NOT allow us to define: correct answers variables whose value can be modified. The statement "a function is a first-class object" means that a function correct answers can be placed in a place where a value is expected. What notation requires parentheses ...

[Show more]

Preview 2 out of 10  pages

  • November 14, 2024
  • 10
  • 2024/2025
  • Exam (elaborations)
  • Questions & answers
  • CSE 240 Fi
  • CSE 240 Fi
avatar-seller
HopeJewels
CSE 240 Final Exam

Functional programming languages do NOT allow us to define: correct
answers
variables whose value can be
modified.
The statement "a function is a first-class object" means that a function
correct
can answers
be placed in a place where a value is
expected.
What notation requires parentheses in order to correctly define
the order of
computation? correct answers infix
notation
Convert the following expression into prefix-p notation (a Scheme
statement):
-5 * (2 + 1/2) + 40 correct answers (+ (* (- 5) (+ 2 (/
1 2))) 40)
One of the major differences between the imperative and functional
programming
languages is that the functional programming languages do NOT (in
general!)...
answers havecorrect
side-
effects.
Which of the following is a valid Scheme expression? correct answers (* 9 (/
(- 4 2) 7))
Convert the following expression into prefix-p notation (a Scheme
statement):
10 + (5 - 3) + correct answers (+ 10 (- 5
3) (/ 2 4))
Given an expression: x1 + x2 +
x3 + x4
Which language allows us to evaluate the expression in this order: (1) x1
x2; (3)
plus x4; (2) sum
x3 of ( x1 + x2 ) plus sum of ( x3 + x4 ), without concern for
producingresult
different a than other evaluation orders: correct answers
Scheme
What is the expected result for this expression (in
Scheme)?
(string-ref "Hello World" 4) correct
answers #\o
Which of the following expression will return false (#f)? correct answers
(number? #\7)
Given this procedure, what is the return
result?
(define (guess
value)
(cond ((number? value) "I'm a
number")
((char? value) "I'm a
character")
((integer? value) "I'm a
integer")))
(guess 10) correct answers "I'm a
number"

, Which of the following are typical advantages of using a REPL for
software
development? correct answers They let you interact with a program
after it hasthe environment to understand what is
populated
happening.
They let you experiment with small pieces of code to understand how
they work.
What data structure is used in Scheme for representing extremely large
integers?
correct answers probably a list. Really: we shouldn't know
or care.
The Scheme form (char? #\5) will return correct answers
true (#t)
What statements contain non-functional features of Scheme? Select all
that apply.
correct answers (begin (write
x) x)
(display
x)
What functional feature does the code below best
exhibit?
(define start-engine
(lambda ()
(error-detection (wheel-velocity (wheel-sensor)) (body-velocity))))
correct answers
procedures are first class
objects.
A let-form in Scheme defines a set of correct answers local
names.
A let-form in Scheme is equivalent (in giving names to values) to correct
answers an
unnamed/lambda
procedure.
Given the Scheme code, answer the following
questions.
((lambda
(x)
((lambda (x
(+
y) x
y))
4 (* 6
x)))
3
) The value to be passed to the parameter y
(1)
is 18
(2) . final output of the piece of code is 22 . correct
The
answers (1) 18
(2)
22
Given the Scheme code, answer the following two
questions.
((lambda
(x)
((lambda (x
y) x
(+
y))
5 (* 7
x)))
3
) The value to be passed to the parameter y
(1)
is 21
(2) . final output of the piece of code is 26 . correct
The
answers (1) 21

The benefits of buying summaries with Stuvia:

Guaranteed quality through customer reviews

Guaranteed quality through customer reviews

Stuvia customers have reviewed more than 700,000 summaries. This how you know that you are buying the best documents.

Quick and easy check-out

Quick and easy check-out

You can quickly pay through credit card or Stuvia-credit for the summaries. There is no membership needed.

Focus on what matters

Focus on what matters

Your fellow students write the study notes themselves, which is why the documents are always reliable and up-to-date. This ensures you quickly get to the core!

Frequently asked questions

What do I get when I buy this document?

You get a PDF, available immediately after your purchase. The purchased document is accessible anytime, anywhere and indefinitely through your profile.

Satisfaction guarantee: how does it work?

Our satisfaction guarantee ensures that you always find a study document that suits you well. You fill out a form, and our customer service team takes care of the rest.

Who am I buying these notes from?

Stuvia is a marketplace, so you are not buying this document from us, but from seller HopeJewels. Stuvia facilitates payment to the seller.

Will I be stuck with a subscription?

No, you only buy these notes for $15.49. You're not tied to anything after your purchase.

Can Stuvia be trusted?

4.6 stars on Google & Trustpilot (+1000 reviews)

75632 documents were sold in the last 30 days

Founded in 2010, the go-to place to buy study notes for 14 years now

Start selling
$15.49
  • (0)
  Add to cart