Question: Write a C++ program that converts a Roman number to its decimal number representation. Roman numerals whose decimal representations are integers between 1 and 3,999.

Write a C++ program that converts a Roman number to its decimal number representation. Roman numerals whose decimal representations are integers between 1 and 3,999.

Ex format:

Enter Roman Num: MCMLXXVIII

Roman Num to Integer: 1987

Use string datatype, no char. Function declaration should be used like: value(input.substr(0, 1))

Not like value(input[0])

(No using stdafx.h)

First write a function that yields the numeric value of each of the letters:

  • I=1

  • V=5

  • X = 10

  • L = 50

  • C = 100

  • D = 500

  • M = 1,000

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!