Question: I need help coding this activity. I have an arrayList of integers with their roman numeral and I'm doing Junit testing. I was thinking of

I need help coding this activity. I have an arrayList of integers with their roman numeral and I'm doing Junit testing. I was thinking of using a switch statement because I don't realy understand the recursive approach. I'm trying to teach myself java but I got stuck.

public class HinduToRomanNumeralConverter {

public String convert(int numberToConvert) {

String str = "null";

return str;

}

}

_____________________________________________________________________________

@Parameters public static Collection data() { return Arrays.asList(new Object[][] { { 1, "I"}, { 2, "II" }, { 3, "III" }, { 4, "IV" }, { 5, "V" }, { 6, "VI" }, { 7, "VII" }, { 8, "VIII" }, { 9, "IX" }, { 10, "X" }, { 11, "XI" }, { 14, "XIV" }, { 15, "XV" }, { 16, "XVI" }, { 19, "XIX" }, { 20, "XX" }, { 30, "XXX" }, { 40, "XL", }, { 49, "XLIX" }, { 50, "L" }, { 51, "LI" }, { 59, "LIX" }, { 60, "LX" }, { 70, "LXX" }, { 80, "LXXX" }, { 90, "XC" }, { 91, "XCI" }, { 92, "XCII" }, { 93, "XCIII" }, { 94, "XCIV" }, { 95, "XCV" }, { 96, "XCVI" }, { 97, "XCVII" }, { 98, "XCVIII" }, { 99, "XCIX" }, { 100, "C" }, { 101, "CI" }, // This is complete and satisfactory { 110, "CX" }, { 127, "CXXVII" }, { 144, "CXLIV" }, { 200, "CC" }, { 300, "CCC" }, { 400, "CD" }, { 500, "D" }, { 549, "DXLIX" }, { 600, "DC" }, { 700, "DCC" }, { 800, "DCCC" }, { 900, "CM" }, { 1000, "M" }, { 2000, "MM" }, { 2222, "MMCCXXII" }, { 2345, "MMCCCXLV" }, { 3000, "MMM" }, // This is exceeds expectations }); }

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!