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
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.
Users Browsing this Thread
There are currently 1 users browsing this thread. (0 members and 1 guests)