Answered step by step
Verified Expert Solution
Question
1 Approved Answer
use python3, this is a code structure. Create a program that does the following: . Asks the user to enter a four-digit number. Outputs
use python3,
\
this is a code structure.
Create a program that does the following: . Asks the user to enter a four-digit number. Outputs the number as Roman numerals Your code should all be in one file. To get the hang of Arabic-to-Roman numeral conversion, look at this online converter Do not worry about the second column of Roman numerals, ie., those with lines above them. Your program only needs the numerals I (1) M (1000) To submit: Copy/paste your code and the output from running it with all of these inputs 2999 . 1973 .1956 2018 2000 0400 0040 0004 DO NOT USE any features that we have not yet studied! Hint-1: Use incremental development techniques for this program. For example, don't even think about the conversion problem until you have first managed to separate the four-digit string into four one-digit strings Hint-2: I started off solving the conversion problem by writing out a table of all the digits for each of the four positions within the four-digit string, along with the Roman equivalent of each one. For example, here is the table I created for just the second digit (the hundreds place) 0 1 C 2 CC 4 CD 5 D 6 DC 7 DCC 8 DCCC 9 CM Thus, whenever a 9 is the second digit, the Roman numeral equivalent will contain a CM to represent 900. I put the table above into my docstring for the function that processes the second digitStep 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