Question: Python 3.6- Create an algorithm in a stand alone file. Create a program that will accept a Roman numeral input from keyboard and return to

Python 3.6- Create an algorithm in a stand alone file.

Create a program that will accept a Roman numeral input from keyboard and return to the screen its numeric value. The following roman numeral system a user can input:

The following Roman numerals, with their Arabic equivalents, must be handled: I =1 ;X =10 ;D= 500 ; V=5; L = 50; M = 1000; C = 100

The program does not have to anticipate or handle subtractive prefixes.

All inputs will be in the range [1, ..., 500]. The program does not have to handle a zero, and it does not have to work with Roman numerals larger than 1,000.

One good way to do this is to make a list containing valid Roman numeral characters and use this to accept valid input and reject all others. It is your decision whether the program fails and refuses to accept invalid input characters, or simply ignores invalid characters and performs calculation only using the valid ones but either way, clear instruction to the user must be given both before input is made and when the Roman numeral has been translated to a decimal value. After the user has entered a Roman numeral and been given its value (in decimal), the user should be given an opportunity to run more samples.

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!