This preview shows page 1. Sign up to view the full content.
Unformatted text preview: where
;;
h is a natural number between 1 and 12 inclusive
;;
representing the hour of the appointment
;;
m is a natural number between 0 and 59 inclusive
;;
representing the minute of the appointment
;;
t is a symbol, either 'AM or 'PM
;;
representing the time of day in a 12hour clock 1. Write a Scheme function called xysums that consumes a list of posn structures and produces a list of the sum of the x and y values of each point that has an integer value distance to the origin. Recall that the distance from a point to the origin is !2 + !2 . For example (xysums (list (makeposn 0 1)
(makeposn 1 1) (makeposn 3 4) (makeposn 12 5))) produces (list 1 7 7). Note that the predicate integer? produces true when it consumes an integer value and false otherwise. Assume that the x and y values of the posn structures are integers. It is not necessary to reflect this restriction in the contract. 2. Write a Scheme function bookappointments that consumes two apptime s...
View Full
Document
 Winter '14

Click to edit the document details