
For this quiz, the goal is to see that you understand lists

and can define a procedure that uses them.

You'll be given a variable, daysinmonth,

which is initialized to a list containing 12 entries

where each entry is the number of days in the corresponding month,

so January has 31 days, so that's why we have 31 here.

Februaryat least in a nonleap yearhas 28 days.

March has 31, and so on up to December that has 31 days.

Your goal is to define a procedure called howmanydays

with underscores between the words

that takes as input a number representing a month

and outputs the number of days in that month,

and we should use the conventional way of numbering the months,

so here's a few examples.

If we call howmanydays, passing in 1,

meaning the month January, the output should be 31

since there are 31 days in January,

and that corresponds to the entry in the zeroth position of daysinmonth.

If we call howmanydays, passing in 9, that's September.

We should get 30.