logo Use CA10RAM to get 10%* Discount.
Order Nowlogo
(5/5)

You will design and implement a program that prompts the user for an input with How can I help you? .

INSTRUCTIONS TO CANDIDATES
ANSWER ALL QUESTIONS

Assignment  1

  1. Description

You will design and implement a program that prompts the user for an input with How can I help you? .

User input should be one of three possible kinds:

  • Please convert ***

  • Please convert *** using ***

  • Please convert *** minimally

If user input is not of this form, with any occurrence of *** an arbitrary nonempty sequence of nonspace symbols, then the program should print out

I don't get what you want, sorry mate!

and stop.

 

  • First kind of input. In case the user inputs Please convert ***, then *** should be either a strictly positive integer (whose representation should not start with 0) that can be converted to a Roman number (hence be at most equal to 3999), or a valid Roman number; otherwise, the program should print out

Hey, ask me something that's not impossible to do!

and stop. If the input is as expected, then the program should perform the conversion, from Arabic to Roman or from Roman to Arabic, and print out the result in the form

Sure! It is **

  • Second kind of input. In case the user inputs Please convert *** using ***, then the first *** should be a strictly positive integer (whose representation should not start with 0) or a sequence of (lowercase or uppercase) letters and the second *** should be a sequence of distinct (lowercase or uppercase) letters. Moreover,

the second *** is intended to represent a sequence of so-called generalised Roman symbols, the classical Roman symbols corresponding to the sequence MDCLXVI, whose rightmost element is meant to represent 1, the second rightmost element, 5, the third rightmost element, 10, etc.;

if it is not an integer,  the first ***  is intended to represent a so-called generalised  Roman  number,   that is, a sequence of generalised Roman symbols that can be decoded using the provided sequence of generalised Roman symbols similarly to the way Roman numbers are represented.

If that is not the case, of if it is not possible to convert the first *** from Arabic to generalised Roman or from generalised Roman to Arabic, then the program should print out

Hey, ask me something that's not impossible to do!

and stop. If the input is as expected and the conversion can be performed, then the program should indeed perform the conversion, from Arabic to generalised Roman or from generalised Roman to Arabic, and print out the result in the form

Sure! It is ***

 

  • Third kind of input. In case the user inputs Please convert *** minimally, then *** should be a sequence of (lowercase or uppercase) The program will try and view *** as a generalised Roman number with respect to some sequence of generalised Roman symbols. If that is not possible, then the program should print out

Hey, ask me something that's not impossible to do!

and stop. Otherwise, the program should find the smallest integer that could be converted from ***, viewed as some generalised Roman number, to Arabic, and output a message of the form

Sure! It is *** using ***

 

  • Sample Here are a few tests together with the expected outputs. The outputs of your program should be exactly as shown.

$ python3 roman_arabic.py

How can I help you? Please do my assignment... I don't get what you want, sorry mate!

$ python3 roman_arabic.py

How can I help you? please convert 35 I don't get what you want, sorry mate!

$ python3 roman_arabic.py

How can I help you? Please convert 035

Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert 4000

Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert IIII

Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert IXI

Hey, ask me something that's not impossible to do!

 

3 How can I help you? Please convert 35 Sure! It is XXXV

$ python3 roman_arabic.py

How can I help you? Please convert 1982 Sure! It is MCMLXXXII

$ python3 roman_arabic.py

How can I help you? Please convert 3007 Sure! It is MMMVII

$ python3 roman_arabic.py

How can I help you? Please convert MCMLXXXII Sure! It is 1982

$ python3 roman_arabic.py

How can I help you? Please convert MMMVII Sure! It is 3007

$ python3 roman_arabic.py

How can I help you? Please convert 123 by using ABC I don't get what you want, sorry mate!

$ python3 roman_arabic.py

How can I help you? Please convert 123 ussing ABC I don't get what you want, sorry mate!

$ python3 roman_arabic.py

How can I help you? Please convert XXXVI using VI Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert XXXVI using IVX Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert XXXVI using XWVI Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert I using II Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert _ using _

Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert XXXVI using XVI Sure! It is 36

$ python3 roman_arabic.py

How can I help you? Please convert XXXVI using XABVI Sure! It is 306

$ python3 roman_arabic.py

How can I help you? Please convert EeDEBBBaA using fFeEdDcCbBaA Sure! It is 49036

$ python3 roman_arabic.py

How can I help you? Please convert 49036 using fFeEdDcCbBaA Sure! It is EeDEBBBaA

$ python3 roman_arabic.py

How can I help you? Please convert 899999999999 using AaBbCcDdEeFfGgHhIiJjKkLl Sure! It is Aaaabacbdcedfegfhgihjikjlk

$ python3 roman_arabic.py

How can I help you? Please convert ABCDEFGHIJKLMNOPQRST using AbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStT

Sure! It is 11111111111111111111

 

 

How can I help you? Please convert 1900604 using LAQMPVXYZIRSGN Sure! It is AMAZING

$ python3 roman_arabic.py

How can I help you? Please convert ABCD minimally using ABCDE I don't get what you want, sorry mate!

$ python3 roman_arabic.py

How can I help you? Please convert ABCD minimaly I don't get what you want, sorry mate!

$ python3 roman_arabic.py

How can I help you? Please convert 0I minimally Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert ABAA minimally Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert ABCDEFA minimally Hey, ask me something that's not impossible to do!

$ python3 roman_arabic.py

How can I help you? Please convert MDCCLXXXVII minimally Sure! It is 1787 using MDCLXVI

$ python3 roman_arabic.py

How can I help you? Please convert MDCCLXXXIX minimally Sure! It is 1789 using MDCLX_I

$ python3 roman_arabic.py

How can I help you? Please convert MMMVII minimally Sure! It is 37 using MVI

$ python3 roman_arabic.py

How can I help you? Please convert VI minimally Sure! It is 4 using IV

$ python3 roman_arabic.py

How can I help you? Please convert ABCADDEFGF minimally Sure! It is 49269 using BA_C_DEF_G

$ python3 roman_arabic.py

How can I help you? Please convert ABCCDED minimally Sure! It is 1719 using ABC_D_E

(5/5)
Attachments:

Related Questions

. Introgramming & Unix Fall 2018, CRN 44882, Oakland University Homework Assignment 6 - Using Arrays and Functions in C

DescriptionIn this final assignment, the students will demonstrate their ability to apply two ma

. The standard path finding involves finding the (shortest) path from an origin to a destination, typically on a map. This is an

Path finding involves finding a path from A to B. Typically we want the path to have certain properties,such as being the shortest or to avoid going t

. Develop a program to emulate a purchase transaction at a retail store. This program will have two classes, a LineItem class and a Transaction class. The LineItem class will represent an individual

Develop a program to emulate a purchase transaction at a retail store. Thisprogram will have two classes, a LineItem class and a Transaction class. Th

. SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 1 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

. Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of Sea Ports. Here are the classes and their instance variables we wish to define:

1 Project 2 Introduction - the SeaPort Project series For this set of projects for the course, we wish to simulate some of the aspects of a number of

Ask This Question To Be Solved By Our ExpertsGet A+ Grade Solution Guaranteed

expert
Um e HaniScience

558 Answers

Hire Me
expert
Muhammad Ali HaiderFinance

505 Answers

Hire Me
expert
Husnain SaeedComputer science

748 Answers

Hire Me
expert
Atharva PatilComputer science

607 Answers

Hire Me
March
January
February
March
April
May
June
July
August
September
October
November
December
2025
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
SunMonTueWedThuFriSat
23
24
25
26
27
28
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
1
2
3
4
5
00:00
00:30
01:00
01:30
02:00
02:30
03:00
03:30
04:00
04:30
05:00
05:30
06:00
06:30
07:00
07:30
08:00
08:30
09:00
09:30
10:00
10:30
11:00
11:30
12:00
12:30
13:00
13:30
14:00
14:30
15:00
15:30
16:00
16:30
17:00
17:30
18:00
18:30
19:00
19:30
20:00
20:30
21:00
21:30
22:00
22:30
23:00
23:30