## Problems 34 - 47

9/28  End of 1st Six Weeks

Ex 34 - 38 "Designing" functions video
• Quiz over functions
Designing Functions includes
• function signature { a comment }
• function purpose   { a comment }
• function example(s), usually at least two   { a comment }
• function definition (what we wrote in problems 13 - 22)  { racket code }
• example:  { racket code }
; create tag function
; string string -> string
; given a tag and related content, produces an HTML tag
; "h1" "Grand Opening" -> "<h1>Grand Opening</h1>"
`; "p" "quod et demontratum" -> "<p>``quod et demontratum````</p>" 10/2 Problems 21 - 31 due  ```
• Programming time
• Quiz Functions

10/4

• Programming time
• 39  when you change the WHEEL-RADIUS of the car, the car should get proportionally bigger or smaller
• Ex 39 video
• 40 BSL tests means use the  check-expect  function. Example:  (check-expect  (string-join  "big" "dog")   "big_dog"),  the first argument is your function and the second is your expected answer.  Use the check-expect on the tock function.
• Ex 40 video
• Review functions Review Practice

10/8

• Programming time
• Review functions Review Practice
• demonstrate simple animations
• 41 it is easiest if you place the tree on to the background (currently an empty-scene)
• 42
•   (render-car 0)   should look like        That is, the car is just off the screen.
• Big-Bang video

```10/10 Help students who are behind to catch up  ```
• Review for Quiz retake over Function Basics
• Review functions Review Practice
• 43  Do not do the sine wave, unless you have already seen it in your math class (probably the end of Alg II)
• Currently, the world state represents the number of pixels that the car is from the right side of the scene. So, for every clock tick, we want the ws to increase by three.  When we exit the program we can see the world state (the number of pixels from the right).  We wish to make it so that when we close the program, we see the number of clock ticks.  However, we still want the car to move at the same speed...  clock tick pixels from right (ws) 0 0 1 3 2 6 3 9
Ex 43 video
``` 10/15 ```
•   44 write 3 check-expects for the function hyper.  Then fix hyper so that it works.
• Exercises 31 - 40 due
• As you recall from elementary school, division has remainders.  10 / 2 = 5 r 0,   27 / 10 = 2 r 7,  7 / 2 = 3 r 1
• In Racket we use (quotient 10 2) to get 5 "quotient" and (modulo 10 2) to get 0 "remainder"
• 45  The modulo function can be used to have the cat return to the left edge of the scene, while keeping track of the total number of tocks that have taken place.
• 46 You may use this picture for your cat2
to get a different and obvious look
• Function Quiz retake  moved to 10/17

10/17
•  47  Only display the gauge.
• When the cat is 100% happy { ws is 100 } the gauge should look like this
• When the cat is 50% happy  { ws is 50 } the gauge should like this
• And when 10%  happy { ws is 10 } the gauge should like this
• Function Quiz retake
``` ```