Answer to Question #25068 in C++ for hanrik
For example, the following are roman numbers: XII (12), CII(102), XL (40). The rules for converting a roman number to decimal is as follows:
a. Set the value of the decimal number to zero.
b. Scan the string containing the roman character fro left to right. If the character is not one of the symbols in the numeral symbol set, the program must print an error message and terminate. Otherwise, continue with the following steps:
If the next character is a null character(if the current character is the last character) add the value of the current character to the decimal value.
If the value of the current character is greater than or equal to the value of the next character, add the value of the current character to the de
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!