Write a program that converts a number entered in Roman numerals to a positive integer. Your program should consist of a class, say, roman type. An object of type roman type should do the following: a.Store the number as a Roman numeral. b.Convert and store the number as a positive integer. c.Print the number as a Roman numeral or positive integer as requested by the user. The integer values of the Roman numerals are: M 100 D 500 c 100 L 50 x 10 v 5 I 1 d. Test your program using the following Roman numerals: Mcxiv, Ccclix, and Mdclxvi.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter9: Records (struct)
Section: Chapter Questions
Problem 2PE
icon
Related questions
Question

Write a program that converts a number entered in Roman numerals to a positive integer. Your program should consist of a class, say, roman type. An object of type roman type should do the following:

a.Store the number as a Roman numeral.

b.Convert and store the number as a positive integer.

c.Print the number as a Roman numeral or positive integer as requested by the user.

The integer values of the Roman numerals are:

M

100

D

500

c

100

L

50

x

10

v

5

I

1

d. Test your program using the following Roman numerals: Mcxiv, Ccclix, and Mdclxvi.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
void method
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781305480537
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT