If the user enters "Thursday" and "June" what will the program print?

Answer:

What day is it
? Thursday
What month is it
? June
Free Day

More Relational Expressions

A relational expression need not both involve strings. For example:

"December" = "December"  AND    25 = 25
---------------------         ----------
        true                     true
         ---------------------------
                    true

Here is a program that determines if the day is Christmas:

' Holiday Checker
'
PRINT "What month is it"
INPUT MONTH$
'
PRINT "What date is it"
INPUT DAY
'
IF MONTH$ = "December" AND DAY = 25 THEN
  PRINT "Today is Christmas"
END IF
'
END

Notice that the variable DAY is a numeric variable, so the second relational expression DAY = 25 is comparing two numbers.

There are other holidays in the year. Here is the program with some extra lines for the Independence Day holiday, July 4:

' Holiday Checker
'
PRINT "What month is it"
INPUT MONTH$
'
PRINT "What date is it"
INPUT DAY
'
IF MONTH$ = "December" AND DAY = 25 THEN
  PRINT "Today is Christmas"
END IF
'
IF MONTH$ = __________  AND DAY = ________  THEN
  PRINT "Today is Independence Day"
END IF
'
END

It is OK to add this second IF..END IF structure as it is here. If the day is December 25, the first IF..END IF executes its true branch. Then the second IF..END IF structure tests if it is July 4. This seems stupid to do, since we know that it is not. But logically this is OK. The second test results in FALSE and its true block does not execute.

QUESTION 18:

Fill in the blanks so the second IF tests if the day is July 4.