CASE+Statements

Introduction
We have seen in earlier exercises how to use an IF...THEN...ELSE statement to build conditional statements.

Now consider the following problem: Write a function which takes as input the a 3 character string to represent a month, and returns the number of days in that month.

We could use and IF...THEN...ELSE statement to write the code for this function. It would look like this

However, this can end up with long and cumbersome code. A better solution is to use a CASE statement:



Task 1
Days In The Month

Task 2
Scrabble Word Score