Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

Graph x + y = 5 by hand.

Answered: 1 week ago

Question

Define Management or What is Management?

Answered: 1 week ago

Question

What do you understand by MBO?

Answered: 1 week ago

Question

What is meant by planning or define planning?

Answered: 1 week ago