Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started