2023 Review 1
I. Problems
-
num-list: Integer -> (Listof Integer)
. Using for/list, create a list of numbers from 1 up to and including the given number.(check-expect (num-list 5) (list 1 2 3 4 5))
-
Remove all of the zeros from a list.
packer: (Listof Number) -> (Listof Number)
-
proper-divisors: Integer(m) -> (Listof Integer)
. Given a positive integer m, produce a list of all numbers between 1 and m (not including 1 or m) that divide m.(check-expect (proper-divisors 12) (list 2 3 4 6)) (check-expect (proper-divisors 3) (list))
II. Animation
On a 400x200 background, there is a blue right triangle with legs 100 and 200 and a green semicircle with radius 100. As time passes an orange circle follows the outline of the triangle and then the circle.
Tick Range | Path |
---|---|
0-100 | Triangle hypotenuse |
100-300 | Triangle vertical leg |
300-500 | Circle perimeter |
In “people coordinates”, the equation of the circle is $$ (x-200)^2 + y^2 = 100^2 . $$