lab14i - Roman Numeral in the list and repeat the process....

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Lab Goal : The lab was designed to teach you how to use arrays to simplify solving more complex problems. 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
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Background image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Roman Numeral in the list and repeat the process. Sample Data : 10 100 1000 2500 1500 23 38 49 LXXVII XLIX XX XXXVIII 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 A+ Computer Science Arrays - www.apluscompsci.com Computer Science I Lab 14I ROMAN NUMERALS Lab Value - 120 {1000,900,500,400,100,90, 50,40,10,9,5,4,1} {"M","CM","D","CD","C","XC", "L","XL","X","IX","V","IV","I"} algorithm help basic logic to convert an int to roman loop through the array of numbers while orig num >= curr number add roman to string subtract curr number from orig Files Needed :: RomanNumerals.java Lab14i.java XXXVIII is 38 A+ Computer Science Arrays - www.apluscompsci.com...
View Full Document

Page1 / 2

lab14i - Roman Numeral in the list and repeat the process....

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online