Write a method that takes an int value and tests whether it
is representable by a single letter in a Roman numeral. For
instance 1 can be but 2 cannot.
Write a method that takes a one-character String which will
be a valid character from a Roman number, (i.e. a character appearing in
the String ROMAN_DIGITS from the starter code)
and returns its numeric value as an int.
Write a method that takes an int value that can be represented via a
single character in a roman numeral (i.e. one of the elements
of ROMAN_VALUES from the starter code) and returns the
corresponding one-character String
Write a method that takes a String consisting of a properly
encoded Roman numeral and returns its value as an int.
The digits in Roman numerals are I, V, X, L, C, D, and M which stand for 1, 5, 10, 50, 100, 500, and 1000. Numbers are written with bigger values first, so 12 is "XII".
The only wrinkle is that some numbers are written in “subtractive form” where a smaller valued digit is written first indicating its value should be subtracted from the value of the next digit. For instance, IV for 4, IX for 9, and CM for 900. Subtractive form is never used for values that can be written directly, i.e. VX could mean five but isn’t used since give can be written directly as V.
The Wikipedia article on Roman numerals has a good table of the rules.
Write a method that takes an int and returns a properly
encoded Roman numeral as a String. I.e. this should be the
inverse of decode.