ProgrammingLanguage
You will write 11 SML functions (and tests for them) related to calendar dates. In all problems, a \date" is an SML value of type int*int*int, where the rst part is the year, the second part is the month, and the third part is the day. A \reasonable" date has a positive year, a month between 1 and 12, and a day no greater than 31 (or less depending on the month). Your solutions need to work correctly only for reasonable dates, but do not check for reasonable dates (that is a challenge problem) and many of your function s will naturally work correctly for some/all non-reasonable dates. A \day of year" is a number from 1 to 365 where, for example, 33 represents February 2. (We ignore leap years except in one challenge problem.) s will naturally work correctly for some/all non-reasonable dates. A \day of year" is a number from 1 to 365 where, for example, 33 represents February 2. (We ignore leap years except in one challenge problem.)
用户评论