A coding exercise.
In this exercise we will create a converter that will accept a number representation in Roman numerals and convert it to Arabic numerals.
Roman numerals, as used today, employ seven symbols, each with a fixed integer value, as follows:
Symbol | Value |
---|---|
I | 1 |
V | 5 |
X | 10 |
L | 50 |
C | 100 |
D | 500 |
M | 1000 |
This numeral system also employs subtractive notation; which is an early form of positional notation used with Roman numerals as a shorthand to replace four or five characters in a numeral representing a number with usually just two characters.
Using subtractive notation the numeral VIIII becomes simply IX. Without subtractive notation, XIV represents the same number as XVI (16 in Arabic numerals). With the introduction of subtractive notation, XIV (14) no longer represents the same number as XVI but rather is an alternative way of writing XIIII.
$ yarn install # Or alternatively: `npm install`
$ yarn test # Or alternatively: `npm test`
The MIT License (Expat). See the license file for details.