PRINT "Type 1 or 'R' to convert decimal number to Roman Numeral" PRINT " or anything else to convert Roman Numeral to decimal number" c$ = P$(TRUE)
decimalNumber = 0
invalidInput:
INPUT "Type in the Roman Numeral: ", romanNumeral$
CASE "I", "V", "X", "L", "C", "D", "M" 'do nothing
decimalNumber = decimalNumber + 1000
decimalNumber = decimalNumber + 900
decimalNumber = decimalNumber + 400
decimalNumber = decimalNumber + 100
decimalNumber = decimalNumber + 500
decimalNumber = decimalNumber + 90
decimalNumber = decimalNumber + 40
decimalNumber = decimalNumber + 10
decimalNumber = decimalNumber + 50
decimalNumber = decimalNumber + 9
decimalNumber = decimalNumber + 4
decimalNumber = decimalNumber + 1
decimalNumber = decimalNumber + 5
COLOR n15
, 0:
PRINT "Decimal number: " + S$
(decimalNumber
)
decimalNumber = 0
romanNumeral$ = ""
INPUT "Type in the decimal number: ", decimalNumber
romanNumeral$ = romanNumeral$ + "M"
decimalNumber = decimalNumber - 1000
romanNumeral$ = romanNumeral$ + "CM"
decimalNumber = decimalNumber - 900
romanNumeral$ = romanNumeral$ + "D"
decimalNumber = decimalNumber - 500
romanNumeral$ = romanNumeral$ + "CD"
decimalNumber = decimalNumber - 400
romanNumeral$ = romanNumeral$ + "C"
decimalNumber = decimalNumber - 100
romanNumeral$ = romanNumeral$ + "XC"
decimalNumber = decimalNubmer - 90
romanNumeral$ = romanNumeral$ + "L"
decimalNumber = decimalNumber - 50
romanNumeral$ = romanNumeral$ + "XL"
decimalNumber = decimalNumber - 40
romanNumeral$ = romanNumeral$ + "X"
decimalNumber = decimalNumber - 10
romanNumeral$ = romanNumeral$ + "IX"
decimalNumber = decimalNumer - 9
romanNumeral$ = romanNumeral$ + "V"
decimalNumber = decimalNumber - 5
romanNumeral$ = romanNumeral$ + "IV"
decimalNumber = decimalNumber - 4
romanNumeral$ = romanNumeral$ + "I"
decimalNumber = decimalNumber - 1
COLOR 15, 0:
PRINT "The Roman Numeral is " + romanNumeral$
'for debugging
P$ = pause$
rtn$ = ""
S$ = rtn$