Welcome to Lab 7

By the end of this Lab you should be able to do the following

Lab Topics

Programming Problem

In this problem you are to design and implement a Roman Numeral Calculator. The subtractive style of Roman numeral notation we use today (such as IV meaning 4) was apparently not used much in Roman times but it is the style used today so that is what we will go with. Your program inputs two Roman numbers with an arithmetic operator and displays the result of the operation, also as a Roman number. The values of the Roman digits are as follows

I V X L C D M
1 5 10 50 100 500 1000

As an example 1984 looks like MCMLXXXIV. The arithmetic operations your program must support are +,-,*, and /. These should perform the Java operations of integer plus, minus, times, and divide. One way to approach the this problem is to convert the Roman numbers into integers, perform the required operation, and then convert the result back into a Roman number for display. The following could be a sample run of the program

java RomanCalc
Enter Roman expression with spaces IX * IV
IX * IV = XXXVI