Results 1 to 2 of 2

Thread: Algorithms Roman Numeral Conversion

  1. #1
    Join Date
    Jul 2005

    Lightbulb Algorithms Roman Numeral Conversion

    Hi I start learning Development and my teacher ask me to write an algorithms for "Roman Numeral Conversion ".
    Could you please help me

  2. #2
    Join Date
    Aug 2004
    I'm against doing people's homework for them, but here are some hints:

    You'll need a data table of some sort such as an associative array to relate each roman digit (i, v, x, etc.) to its decimal equivalent.

    Walk through the roman numeral string character by character. If the character is not the last in the string, look at the next character, and if the next character is greater than the current character, subtract the current character's decimal value from the running total, otherwise add it to the total.
    "Well done....Consciousness to sarcasm in five seconds!" ~ Terry Pratchett, Night Watch

    How to Ask Questions the Smart Way (not affiliated with this site, but well worth reading)

    My Blog
    cwrBlog: simple, no-database PHP blogging framework

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
HTML5 Development Center