Answered step by step
Verified Expert Solution
Link Copied!

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Design And SQL For DB2

Authors: James Cooper

1st Edition

1583473572, 978-1583473573

Students also viewed these Databases questions

Question

Finding and scheduling appointments with new prospective clients.

Answered: 1 week ago