Question: Write a program that takes as input positive integers and converts them into then Roman numeral system equivalents. Requirements: Check for valid input - your

 Write a program that takes as input positive integers and converts

Write a program that takes as input positive integers and converts them into then Roman numeral system equivalents. Requirements: Check for valid input - your program should handle runtime exceptions caused by invalid input Your program should continue running until the user indicates a desire to quit Besides checking for input validity, your program must check for data out of bounds (as described below) and deal with it in a reliable manner (i.e. don't crash and don't produce bad output) The Roman numeral system uses the following symbols to represent the numeric values listed below: I 1 V 5 X 10 L 50 C 100 D 500 M 1000 Numbers are formed according to the following rules: Only numbers greater than 0 and up to 3999 are represented (your program should check for this) As in the decimal system, the thousands, hundreds, tens and ones are expressed separately. The numbers 1 - 9 are expressed as: I 1 II 2 III 3 IV 4 V 5 VI 6 VII 7 VIII 8 IX 9 Generally, an 'I' preceding a 'V' or 'X' is subtracted from the second letter's value, and you never have morethan 3 'I's in a row. Tens and hundreds are done the same way, except that the letters X, L, C and C, D, M are used instead of I, V andX respectively. A sample program run: Hail Caesar! Enter a number to be converted to Roman numerals, or 0 to quit: 1978 That number is: MCMLXXVIII Enter a number to be converted to Roman numerals, or 0 to quit: quit is not valid input. Enter a number to be converted to Roman numerals, or 0 to quit: -5 -5 is out of bounds. Please enter a number between 1 and 3999. Enter a number to be converted to Roman numerals, or 0 to quit: 267 That number is: CCLXVII Enter a number to be converted to Roman numerals, or 0 to quit: 0 Beware the ides of March1

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!