I'm taking an online C++ class and having some difficulty understanding the assignments. Can someone please look at the code I wrote to ensure validity? I am not asking for the answer just some guidance, I’m totally lost.
The assignment is as follow:
Write a prg to convert numbers entered in Roman Numeral to decimal. Your prg should consist of a class, say romanType. An object of the type romanType should do the following:

a. Store the number as a Roman numeral
b. Convert and store the number into decimal
c. Print the number as Roman numeral or decimal number as requested by the user.

The decimals values of the Roman numerals are:
M 1000
D 500
C 100
L 50
X 10
V 5
I 1

Here is the code I attempted to write.
void store the number
//Function to store the Roman numerals
void convert and store the number to decimal
//Function convert number to decimal
void printNumber () const;
//Function to print the number after user input
//Postcondition: The number is printed as
M = 1000
D = 500
C = 100
L = 50
X = 10
V = 5
I = 1

I know this need lots of correction, so I'm open for the help.


Recommended Answers

All 2 Replies

Use code tags.

and actually write some code...
Just putting a few {s and }s and a void or two into your assignment doesn't constitute an effort...

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.