## Problems 34 - 47

2/15  End of 1st Six Weeks

Ex 34 - 38 "Designing" functions video
• Review for quiz over functions
Designing Functions includes
• function signature
• function purpose
• function example(s), usually at least two
• function definition (what we wrote in problems 13 - 22)
• example:
; 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>" 2/20 Problems 21 - 31 due  ```
• Programming time
• Quiz Functions

2/22

• 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

2/26

• Programming time
• 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

```2/28 Help students who are behind to catch up  ```
• Review for Quiz over Function Basics
• Exercises 31 - 40 due
• 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
``` 3/2 Quiz on Function basics ```
•   44 write 3 check-expects for the function hyper.  Then fix hyper so that it works.

• 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 and (modulo 10 2) to get 0
• Divide the following sequence of numbers by 3 paying close attention to the remainders { 0, 1, 2, 3, 4, 5, 6, 7, 8 ,9 10  How does this change if you divide he same sequence by 5?
• 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

•  47  Only display the gauge.  When the cat is 100% happy the gauge should look like this
, 50% like this
and 10%, like this
``` ```