PYTHON!!! For 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 shown below: I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 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, VVI and CCXLIII ARE NOT!!! Write two programs that perform the following: 1. The first program should ask the user to enter a number that is represented in the simplified Roman numerals system, and the program will print it’s decimal value. For example, an execution would look like the following. User input is shown in bold face font. Enter number in the simplified Roman system: CXXXXVII CXXXXVII is 147 2. Reads from the user a (decimal) number, and prints it’s representation in the simplified Roman numerals system. For example, an execution would look like the following. User input is shown in bold face font. Enter decimal number: 147 147 is CXXXXVII DO NOT USE any language construct not taught. This includes user-defined functions (including main()), file i/o, exception handling, dictionaries, lists, tuples, and object orientation!!!

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

PYTHON!!!

For 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 shown below:

I = 1, V = 5, X = 10, L = 50, C = 100, D = 500, M = 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, VVI and CCXLIII ARE NOT!!!

Write two programs that perform the following:

1. The first program should ask the user to enter a number that is represented in the simplified Roman numerals system, and the program will print it’s decimal value.

For example, an execution would look like the following. User input is shown in bold face font.

Enter number in the simplified Roman system: CXXXXVII

CXXXXVII is 147

2. Reads from the user a (decimal) number, and prints it’s representation in the simplified Roman numerals system. For example, an execution would look like the following. User input is shown in bold face font.

Enter decimal number: 147

147 is CXXXXVII

DO NOT USE any language construct not taught. This includes user-defined functions (including main()), file i/o, exception handling, dictionaries, lists, tuples, and object orientation!!!

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Random Class and its operations
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education