Struct B

  1. Make a structure qqq that holds a number A, a color C, and another number M.

  2. Make a draw handler that shows two solid circles, one with radius 10 centered at (A,10), and one with radius 15 centered at (100, M). Both circles are color C.

  3. Moving the mouse always sets M to y.

    1. Make an example that you turn into a check-expect.
    2. Write code for this part of the job.
  4. Clicking the mouse subtracts 10 from A.

    1. Make an example that turns into a check-expect.
    2. WRite code for this part of the mouse handler.
  5. If you have not yet combined the two previous parts, do that now to create one mouse handler. A common problem is not handling unusual mouse events like “enter” (mouse enters the window).

An example of this is available in CPS or on YouTube.

Last modified February 20, 2025: Struct-focused review exercises. (b2c97fb)