You are not allowed to write any production code unless it is to make a failing unit test pass.
You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
We would like to be able to convert Arabic numbers into their Roman numeral equivalents.
We just need some kind of program that can accept a numeric input and output the Roman numeral for the input number.
1 --> I 10 --> X 7 --> VII
etc.
Arabic # Roman # Arabic # Roman #
1 I 8 VIII
2 II 9 IX
3 III 10 X
4 IV 20 XX
5 V 30 XXX
6 VI 40 XL
7 VII 50 L
60 LX 400 CD
70 LXXX 500 D
80 LXXX 600 DC
90 XC 700 DCC
100 C 800 DCCC
200 CC 900 CM
300 CCC 1000 M
|
Examples
Arabic # Roman # Thousands Cents Tenths Units
846 DCCCXLVI - DCC XL VI
1999 MCMXCIX M CM XC IX
2008 MMVIII MM - - VIII
|