Question: Lab Goal : The lab was designed to teach you more about objects and classes. Lab Description : In this program, you are to create
Lab Goal : The lab was designed to teach you more about objects and classes. Lab Description : In this program, you are to create a Roman Numeral class to handle roman numeral operations. How to convert a Roman Numeral to a standard base ten number : : Locate the first individual roman number in the roman number string. Sum up the numeric value of the individual number. Chop of the individual roman numeral from the string and continue the process if the string has more numbers left. How to convert a standard base ten number to a Roman Numeral : : Find the first Roman numeral less than the number. Add the roman numeral to a string. Subtract the value of the Roman Numeral from the number. Repeat this until the original number is less than the current Roman Numeral. Move to the next Roman Numeral in the list and repeat the process. Sample Data : see the main Sample Output : 10 is X 100 is C 1000 is M 2500 is MMD 1500 is MD 23 is XXIII 38 is XXXVIII 49 is XLIX LXXVII is 77 XLIX is 49 XX is 20 XLIX is 49 Roman 1 :: XXI Roman 2 :: XXV rOne.equals(rTwo) == false rOne.compareTo(rTwo) == -4 rTwo.compareTo(rOne) == 4
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
