I601--Assignment One

Sesame Street Simulator

Your assignment is to write a Pascal program which will demonstrate simple counting. The program must work for all numbers between zero and ten inclusive. Each time that the machine is ready to count it will ask the user for one number. If the input number is five or less the output counting should start at the input number and count up to ten. If the input is six or more the output should start at the input and count down to zero.

For example:

WELCOME. PLEASE ENTER A NUMBER.

3

I'M COUNTING:

3 4 5 6 7 8 9 10

WELCOME. PLEASE ENTER A NUMBER.

7

I'M COUNTING:

7 6 5 4 3 2 1 0

WELCOME. PLEASE ENTER A NUMBER.

Set your program up so it does five numbers and then quits. You don't have to follow my sample output -- in fact I'd like it if you made it more helpful to the user (but try to avoid the verbose.)

If you want to make your program more exciting try any or all of the following:

1) Have the program give an error message for numbers that are outside the bounds of the program.

2) Have the program keep coming back to count again until some special number (eg 99) is entered.

3) Let the user specify more about the counting -- how high, how low, the step size (eg by two's.)

When you hand in your program include a listing and a complete run of your program with enough test data to show that the program works.