swap-x-y which
takes in a posn
and returns a new posn with the coordinates swapped: the x coordinate of
the
output should be the y coordinate of the input, and vice versa.scale-posn
which takes in a
number and a posn, and returns a posn formed by multiplying the number by
each of the coordinates of the input posn.
For example, (scale-posn 3 (make-posn 2 5)) "should be"
(make-posn 6 15).choose-posn
that takes in a
string and two posns. The string should be either "first" or "second". The
choose-posn function should return either the first or the second of its
two posns, as directed by the string. (Hint: You probably want to
use a conditional expression as the function body for this
function.)| Grading | Contract | Purpose | Data Analysis | Examples | Skeleton | Inventory | Definition | Testing |
| 15.5.2 | /3 | /2 | N/A | /3 | /3 | /4 | /12 | /3 |
| 15.5.3 | /3 | /2 | N/A | /3 | /3 | /4 | /12 | /3 |
| 15.5.7 | /3 | /2 | /6 | /3 | /3 | /6 | /16 | /3 |
Last Modified: 12/6/08