Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Part A: Roman numerals In the first part of this assignment you will play around with converting some integers into Roman numerals for more on

image text in transcribed
Part A: Roman numerals In the first part of this assignment you will play around with converting some integers into Roman numerals for more on these go to https://enwikipedia.org/wiki/Roman numerals). Your program will: 1. Prompt the user for a one number integer) from 1 up to and including 20. 2. If the number it outside this range (le, a negative number, or a number greater than 20), then the program will display an error message and stop. 3. Otherwise the program will construct and print the Roman-numeral equivalent of the number provided by the user. The roman numerals from 1 to 10 are: . I, II, III, IV, V, VI, VII, VIII, IX, X and from 11 to 20 are: . XI, XII, XIII, XIV, XV, XVI, XVII, XVIII, XIX, X Notice how the numbers from 11 to 20 are just "X" followed by the equivalent roman numerals when the number has ten subtracted from it. Your solution must make use of some combination of if statements, if-else statements, nested decision structures and if-elif-else statements (although you are not strictly required to use every one of the conditional instruction forms just listed). For those who already know how to use lists and dictionary, you are not to use these in your solution. And some further notes on writing a solution: Better solutions (i.e., ones getting more marks) will avoid answering the question in one big if-elif-else having 20 or so blocks. You can take advantage of using temporary variables of your own choosing, such as subtracting or adding from the value provided by the user. . You can build the resulting Roman number step by step, adding a letter in one conditional statement, adding another letter (or letters) in another conditional statement . Don't forget that you can use multiplication on strings, e.g. 3 is the same as Below is a transcript of a session where the user asks for the roman-numeral equivalent of 18. What is the number to covert (from 1 to 20)? 18 18 in Roman numerals is XV

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Inductive Databases And Constraint Based Data Mining

Authors: Saso Dzeroski ,Bart Goethals ,Pance Panov

2010th Edition

ISBN: 1489982175, 978-1489982179

More Books

Students also viewed these Databases questions

Question

Identify conflict triggers in yourself and others

Answered: 1 week ago