17.D

This worksheet addresses a number of challenging misconceptions. Read closely and consider you answers thoughtfully.

(define (keeper n) 
  (overlay (text "Yes" n "blue") 
           (rectangle 400 300 "solid" "transparent")))
(big-bang 100
  (to-draw keeper))
  1. What is the signature for the draw handler in the animation above?
  2. Describe in words briefly how to interpret the model. (How do you see changes visually.)
  3. When the animation stops, you want to change the background color to pink. Write the “win screen draw handler”.
  4. The model is always supposed to be a number with absolute value between 5 and 250. Write a function a-ok? to use in the check-with clause of the big bang.
  5. Anastasia wants hitting a key to change to a light pink background and show “No”. What do you think about this idea? (See code below.) Explain.
(define (ana model key) 
   (overlay (text "No" model "blue")
            (rectangle 400 300 "solid" "light pink")))
  1. Amarga wants moving the mouse to the top right corner of the screen to change the font size to 18 point. Write a check-expect for the mouse handler amarga-m.

  2. Amarga also wants moving the mouse to the middle right side of the screen to change the font size to 50 point. Write a check-expect that expresses this.

Last modified January 3, 2022: Ch17 work and review. (7de4614)