Develop a function called season
that consumes a month (as a String) and a day (a Natural). The function produces the season (a String) for that date.
The Design Recipe steps for developing a function are
check-expect
season
function.
season
function. Remember that you should be writing test cases against the signature/purpose of the function, not against any particular implementation of the function. Another way to say this is that you write test cases before you write the function definition; all you have to go on when you develop tests are the signature/purpose. (For this problem, the dates of each season, as given in the description above, should be part of the purpose.)
After you finish problem 2, ask one of the lab assistants to check over your work to make sure you're on the right track. Did you have enough test cases?
season
. Use cond
in your solution (not if
). If you're not sure how to use cond
, re-view video assignment HtDD - cond Expressions on edpuzzle.com.
season
function to run correctly, don't worry; you may complete it on your own time. Today you should turn in whatever you've completed at the end of the 50-minute lab period.
Using InstructAssist,
turn in a single file containing the work you completed during the lab. The name of the project is Lab 1
. The name of the file should be yourLastName-lab1
.