Back Summary

Session #5

Multiple choice: 12/15 correct ยท Short answer: 0/0 answered · completed Sep 6, 2026

Answers

What does Racket ultimately evaluate an expression into?

✓ A value

Which expression correctly follows Racket prefix notation?

✓ (+ 3 4)

What does (substring "012345" 2 4) produce?

× "234"
✓ "23" (correct answer)

Which library is required for primitives such as rectangle and image-width?

✓ 2htdp/image

What does the text primitive produce?

× A String
✓ An Image (correct answer)

What happens when Racket evaluates a constant name such as WIDTH?

✓ It replaces the name with its defined value

What is a predicate?

✓ A function or primitive that produces a Boolean

How does an if expression evaluate its branches?

✓ Only the branch selected by the Boolean question evaluates

What happens when evaluating (and false (/ 1 0))?

× Division by zero occurs
✓ The result is false without evaluating the division (correct answer)

Which statement about or is correct?

✓ It is true if any expression is true

Why are parameters useful in a function?

✓ They let the same logic operate on different values

In a function call, what normally happens before parameter values are substituted into the body?

✓ Arguments are reduced to values

What is the best description of overlay compared with above?

✓ overlay stacks images in the same space

What is a good use of the DrRacket Stepper?

✓ Seeing the order in which subexpressions reduce

If you know the primitive beside and want a related image-layout primitive, what strategy from the notes is appropriate?

✓ Search the documentation for beside and scroll around related primitives