Convert roman

Application Kata „Convert roman“

Write a console program to convert to and from roman numbers. Example usage:

$ convertroman XLII
42
$ convertroman MMXV
2015
$

The number to convert – either roman or arabic – is passed in as a command line parameter. The converted numer – either arabic or roman – is written to standard output.

Only roman numbers in the range I to MMM need to be considered.

Variation #1

Let the user specify a text file containing a number to convert on each line. Example:

$ convertroman –f=numbers.txt
XLII
2015
$

with numbers.txt containing:

42
MMXV

Resources

[1] Wikipedia, Roman Numerals