INFO 601
Student Proficiencies - Week 2
1) Simple branching:
a)
TYPE 1 IF YOU THINK IT IS A GOOD DAY OTHERWISE TYPE 2
if 1 is typed then reply:
HAVE A GOOD DAY
always close by saying:
ANYWAY HAVE A DAY
b)
repeat the above for responses of yes and no
(note we ignore the no just as we ignored 2 ABOVE)
2) Branching in two directions
a)
ENTER A NUMBER
if the number is less than 5 write:
n IS A SMALL NUMBER
if the number is 5 or bigger write:
n IS A BIG NUMBER
(you fill in the value for n)
b)
same as above except use the user's idea of what is big. Start with:
WHAT IS THE SMALLEST BIG NUMBER?
3)Multiple branching
a) ENTER A NUMBER
if the number is less than 5 write:
n IS A SMALL NUMBER
if the number is 5 or bigger ask:
GIVE ME A SMALLER NUMBER
if the number is smaller write
YES, x IS SMALLER THAN n.
if it is not then write.
NO, x IS NOT SMALLER THAN n.
b) add to a) in the following way:
If the last number entered (no matter which branch was followed) was negative write
WOW, z IS VERY SMALL!