Question: Question to be written in C++ - I need help with the explanations for why we use certain variables/the steps for this problem. Thanks! In

Question to be written in C++ - I need help with the explanations for why we use certain variables/the steps for this problem. Thanks! Question to be written in C++ - I need help with the

In this question, we will use a simplified version of the Roman Numerals System to represent positive integers. The digits in this system are I, V, X, L, C, D and M. Each digit corresponds to a decimal value, as showed in the following table: Roman digit IV x LCDM Decimal value 1 5 10 50 100 500 1000 A number in the simplified Roman numerals system is a sequence of Roman digits, which follow these 2 rules: 1. The digits form a monotonically non-increasing sequence. That is the value of each digit is less than or equal to the value of the digit that came before it. For example, DLXXVI is a monotonically non-increasing sequence of Roman digits, but XIV is not. 2. There is no limit on the number of times that 'M' can appear in the number. 'D', 'l' and 'V' can each appear at most one time in the number. 'C', 'X' and I can each appear at most four times in the number. For example: IIII, XVII and MMMMMMDCCLXXXXVII are legal numbers in our simplified Roman numeral system, but IIIII, XIV, VI and CCXLIII are not. Write 2 programs: a. Reads from the user a number that is represented in the simplified Roman numerals system, and prints it's decimal value. Sample output: Enter number in the simplified Roman system: CXXXXVII CXXXXVII is 147

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!