Ch07 WS 04
-
Write the function
fix: number -> number
that has the following properties:- input < 100 gives an output of 100
- input > 300 gives an output of 300
- otherwise the output is the same as the input
-
Write the function
rand5: anything -> integer
. This function outputs a random multiple of 5 between 100 and 150 (inclusive). -
Write the function
rand-shapes: anything -> image
. This function outputs an image of a square next to the image of a circle.- The radius of the circle equal to the side length of the square.
- The radius of the circle is one of 20, 30, 40, 50, …, 100.
-
(Summary.) Create a random house-making function,
rh : anything -> image
. A house is triangle exactly fitting over a square. The width of the house should be chosen randomly among the numbers 120, 140, 160, …, 280.