Write a program that stores and converts a number entered


Write a program that stores and converts a number entered in Roman numerals to an integer value. Your program must consist of a class named Roman. An object of type Roman must do the following:

1.) Store the number as a Roman numeral,

2.) Convert and store the number also as an integer value,

3.) Print the number as a Roman numeral or integer number as requested by a method call,

4.) Implements a constructor.

So for example, you should be able to write a program that looks something like this:

Roman r = new Roman("MCXIV");

r.printInt(); //prints 1114

r.printRoman(); //prints MCXIV

Roman s = new Roman("CCCLIX");

s.printInt(); //prints 359

The Roman numerals are:

I = 1

V = 5

X = 10

L = 50

C = 100

D = 500

M = 1000

Solution Preview :

Prepared by a verified Expert
C/C++ Programming: Write a program that stores and converts a number entered
Reference No:- TGS01255512

Now Priced at $20 (50% Discount)

Recommended (90%)

Rated (4.3/5)