Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I don't excpect a complete code just up until the tens would be great to point me in the right direction. Note: if the user
I don't excpect a complete code just up until the "tens" would be great to point me in the right direction.
Note: if the user types roman letters in an illogical order (ex. tens >> hundreds) it should print out Error.
Thank you!
Write a C program project2.c that operates as follows. First your program reads a string which is expected to be an extended Roman numeral, and then it converts this string to an integer in the range from-3,999,999 to 3,999,999. Next your program should display this integer, unless the input string is not a valid extended Roman numeral, in which case it should just display the string "Error" The entire input is one string. The entire output is either an in teger or the string rror" Classical Roman numerals are converted to integers one digit as a time, as Units Thousands Hundreds Tens 1000 100 10 2000 200 20 II CC 3000 300 CCC 30 400 40 4 I 00 600 60 LX DC 700 DCC 70 VII 800 DCCC 80 VII 900 90 CM XC For this project, we extend the Roman numeral notation to obtain a larger range as follows: Hundred thousads Ten thousands Millions Thousands 1000000 100000 10000 1000 2000000 NN 200000 BB 20000 2000 MM 3000000 NNNN 300000 BBB 30000 YYY 3000 MMM 400000 BE 40000 YK 4000 00000 50000 K 000 600000 EB 60000 KY 6000 UNM 700000 EBB 70000 7000 800000 EBBB 80000 KYYY 8000 900000 BN 90000 YB 9000 Furthermore, if the leading character in the input is then this denotes a negative integer, and if the entire string is then this denotes the integer 0. Here are some example inputs and the corresponding expected outputs. There should be no prompts before reading the input string. CS Error NNYKDCV III 2040608 BBY YYMUDLXVII 1234567 NNIN BEKUMDCCL XXXIX 3456789 BBBULXX 305070 IBM ErrorStep 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