"Thirty days hath September, April, June, and November; all the rest have thirty-one, save February alone ..."
Write a program that uses the input of a number from 1 to 12, representing the month, and produces the number of days in that month. Assume the user specifies the month number as an argument when calling the program. (Include in the program an ARG instruction to assign the month number into the variable month). Then have the program produce the number of days. For month 2, this can be 28 or 29.
/******************************** REXX *******************************/
/* This program uses the input of a whole number from 1 to 12 that */
/* represents a month. It produces the number of days in that */
/* month. */
/*********************************************************************/
ARG month
SELECT
WHEN month = 9 THEN
days = 30
WHEN month = 4 THEN
days = 30
WHEN month = 6 THEN
days = 30
WHEN month = 11 THEN
days = 30
WHEN month = 2 THEN
days = '28 or 29'
OTHERWISE
days = 31
END
SAY 'There are' days 'days in Month' month'.'