PRINT "Enter a Number" INPUT NUMBER ' IF NUMBER >= 0 THEN PRINT "The square root is:", SQR( NUMBER ) ELSE PRINT "There is no square root" PRINT "Run the program again." END IF ' PRINT "Bye" END
In this program that there are a different number of statements in the true branch than in the false branch. This is fine.
Think about a program for a theater's box office. The program asks for a person's age. Next, if the age is greater than 16 the program writes out "adult rate". Otherwise the program writes out "child rate." Here is a skeleton of the program:
PRINT "Enter age" INPUT AGE ' IF___________THEN PRINT "adult rate" ELSE PRINT "child rate" END IF ' PRINT "done" END
Complete the blank so the program picks
the correct PRINT
statement for the age that was input.