Skip to main content
guest
Join | Help | Sign In
Liberty BASIC Community Wiki Home
guest| Join | Help | Sign In
Liberty BASIC Community Wiki
  • Wiki Home
  • Recent Changes
  • Pages and Files
  • Members
  • Home
    • Liberty BASIC FAQ
    • Contests
    • Tutorials
    • Science
    • Shared Code
    • Tips
    • DLLs
    • PublicDomainSprites
    • Member Pages
    • Links
    • Sandbox

Convert to Roman Numeral

Edit 1 3 …
  • 0 Tags
    • No tags
  • Notify
  • RSS
  • Backlinks
  • Source
  • Print
  • Export (PDF)
Older Version Newer Version

bradmoore bradmoore Jan 24, 2006

This little program will conver numbers to Roman Numerals. It is able to conver any value from 1 to 3999. Roman's did not have a consistent numbering scheme after 3999. [[code format="qbasic"]] 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 < 4000 then for x = 0 to 12 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) wend next x print "The ROMAN conversion is: ";roman$ else print "The number to be converted is over 3999 - try again." end if confirm "Convert another?";a$ if a$ = "yes" then goto [again] [[code]] [[user:bradmoore|1138148626]]
Help · About · Pricing · Privacy · Terms · Support · Upgrade
Contributions to https://basic.wikispaces.com/ are licensed under a Creative Commons Attribution Share-Alike 2.5 License. Creative Commons Attribution Share-Alike 2.5 License
Portions not contributed by visitors are Copyright 2018 Tangient LLC
TES: The largest network of teachers in the world
Turn off "Getting Started"
  1. Home
  2. ...
Loading...