scapegoat
Jan 24, 2006
- "typo conver --> convert"
This little program will convert numbers to Roman Numerals. It is able to convert any value from 1 to 3999. Romans did not have a consistent numbering scheme after 3999.
DIM i(13)DIM r$(13)KEY$ ="1000 M 900 CM 500 D 400 CD 100 C 90 XC 50 L 40 XL 10 X 9 IX 5 V 4 IV 1 I"[again]
roman$ =""INPUT"Please enter a number:";num
IF num <4000THENFOR x =0TO12
i(x+1)=VAL(word$(KEY$,(x*2)+1))
r$(x+1)= word$(KEY$,(x*2)+2)WHILE num >= i(x+1)
roman$ = roman$ + r$(x+1)
num = num - i(x+1)WENDNEXT x
PRINT"The ROMAN conversion is: ";roman$
ELSEPRINT"The number to be converted is over 3999 - try again."ENDIF
confirm "Convert another?";a$
IF a$ ="yes"THENGOTO[again]
-