! Ask a user to enter a number

! between 1 and 5 inclusive.

! Your program should allow the user

! to enter any sequence of characters.

! Check the input, and if it is longer

! than one character, is not numeric,

! or is not in the proper range, display

! an error message that describes the

! specific error. If the input is not

! correct, ask the user to try again.

! Test your program using the numbers

! 0,1,4,5, and 8,

! also the characters Z, #3, and A1A.

 

PRINT "Please enter a number between 1 and 5, inclusive "

LET done$="false"

DO until done$="true"

LINE INPUT a$

IF len(a$)>1 then

PRINT "Your number ";a$;" is too long, please try again"

ELSEIF ord(a$)<48 or ord(a$)>57 then

PRINT "Your entry ";a$;" is not a number, try again"

ELSEIF ord(a$)<49 or ord(a$)>53 then

PRINT "Your number ";a$;" is not in the proper range"

ELSE

PRINT "Your number is ";val(a$ );" , thanks!"

LET done$="true"

END IF

LOOP

END