久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

代寫COMP9021、代做Python程序語言

時間:2024-03-27  來源:  作者: 我要糾錯



COMP9021 Principles of Programming
Term 1, 2024
Assignment 1
Worth 13marks and due Week 7 Monday @ 10am
1. General Matters
1.1 Aim
The purpose of this assignment is to:
• develop your problem-solving skills.
• design and implement the solution to a problem in the form of a medium sized Python program.
• practice the use of arithmetic computations, tests, repetitions, lists, and strings.
• use procedural programming.
1.2 Marking
This assignment is worth 13 marks distributed approximately as follows:
1.50 marks for "I don't get what you want, sorry mate!"
3.50 marks for "Hey, ask me something that's not impossible to do!"
2.25 marks for "Please convert ***"
2.50 marks for "Please convert *** using ***"
3.25 marks for "Please convert *** minimally"
 ----------------------------------------------------------------------
13.00 marks total
Your program will be tested against several inputs. For each test, the automarking script will let your
program run for 30 seconds. The outputs of your program should be exactly as indicated.
2
1.3 Due Date and Submission
Your program will be stored in a file named roman_arabic.py. The assignment can be submitted
more than once. The last version just before the due date and time will be marked (unless you submit late
in which case the last late version will be marked).
Assignment 1 is due Week 7 Monday 25 March 2024 @ 10:00am (Sydney time)
Note that late submission with 5% penalty per day is allowed up to 5 days from the due date, that is, any
late submission after Week 7 Saturday 30 March 2024 @ 10:00am will be discarded.
Make sure not to change the filename roman_arabic.py while submitting by clicking on [Mark]
button in Ed. It is your responsibility to check that your submission did go through properly using
Submissions link in Ed otherwise your mark will be zero for Assignment 1.
1.4 Reminder on Plagiarism Policy
You are permitted, indeed encouraged, to discuss ways to solve the assignment with other people. Such
discussions must be in terms of algorithms, not code. But you must implement the solution on your own.
Submissions are scanned for similarities that occur when students copy and modify other people’s work or
work very closely together on a single implementation. Severe penalties apply.
2. 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 the user input is not of this form, with any occurrence of *** an arbitrary nonempty sequence
of non-space symbols, then the program should print out:
I don't get what you want, sorry mate!
and stop.
3
2.1 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 ***
2.2 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, or 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.
4
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 ***
2.3 Third Kind of Input
In case the user inputs Please convert *** minimally, then *** should be a sequence
of (lowercase or uppercase) letters. 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 ***
5
3. Sample Outputs (or Test Cases)
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!

6
$ python3 roman_arabic.py
How can I help you? Please convert IXI
Hey, ask me something that's not impossible to do!
$ python3 roman_arabic.py
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

7
$ 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!

8
$ 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

9
$ python3 roman_arabic.py
How can I help you? Please convert ABCDEFGHIJKLMNOPQRST using
AbBcCdDeEfFgGhHiIjJkKlLmMnNoOpPqQrRsStT
Sure! It is 11111111111111111111
$ python3 roman_arabic.py
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!

10
$ 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
11
4. Hints
4.1 Explaining the following example of the third kind of input
(Please convert *** minimally):
$ python3 roman_arabic.py
How can I help you? Please convert ABCADDEFGF minimally
Sure! It is 49269 using BA_C_DEF_G
First, remember the two important Roman numeral rules below:
1. A Roman symbol is repeated three times but not more than that. However, the symbols V (5),
L (50) and D (500) are never repeated.
2. The Roman symbols V (5), L (50) and D (500) are never written to the left of a symbol of
greater value, i.e., V (5), L (50) and D (500) are never subtracted. The symbol I (1) can be
subtracted from V (5) and X (10) only. The symbol X can be subtracted from L (50) and C (100)
only.
Note also that "minimally" means we are looking for a generalised Roman symbols that can
convert the given numeral into a smallest integer number.
Let us start assigning Roman numeral values from the right-hand side such that the value is
minimum.
Starting with F, we can see it is repeated and we have to assign the minimum value to FGF in
order to assign the minimum value to F. From a number of various combinations, we know
that the only possible solution here is F=10 and G=1 (try out combinations of 1, 5, 10 here to
see why this is the right one). Thus FGF=19.
Let us move now to the next element, which is E. We also need to consider the element after
E in order to assign a smaller combination, if possible, in this case. The next element is D,
which is repeated and therefore cannot be less than E. Thus, we assign E the smallest number
not used yet, which is 50. Moving on to D, since it is repeated, it cannot be greater than the
next element A. Thus, we assign the smallest number not yet used which is 100 to D.
Till now, our number DDEFGF is resulting in 269 using DEF_G (value 5 not assigned).
The next element is A and it is repeated. To assign a value to A, we must assign a value so that
ABCA does not violate Roman numeral rules. That is, A < B and B > C. Because of AB (A and B
being next to each other), we cannot assign A as 500 (500 cannot be subtracted from any
number).
12
Let us say we assign 1000 to A. Then B can be either 5000 or 10000. B cannot be 5000 because
that would mean C can only be 500. Also, B cannot be 10000 as it would mean C should be
5000 or 500 (both are invalid assignments).
Let us try to assign 10000 to A (it cannot be assigned 5000 since it is repeated). B can be either
50000 or 100000. If B is 50000, C can be either 5000, 1000 or 500. C cannot be 5000 or 500
(since they be subtracted from any number). C can be 1000.
Consequently, the smallest we can come up with here is 10000 for A, 50000 for B, and 1000
for C, and ABCA = 50000 - 10000 + 10000 - 1000 = 49000.
Thus, the total becomes 49269 using BA_C_DEF_G (values 5, 500 and 5000 not assigned).
4.2 More examples about the third kind of input
(Please convert *** minimally):
$ python3 roman_arabic.py
How can I help you? Please convert AZERTY minimally
Sure! It is 444 using ZAREYT
$ python3 roman_arabic.py
How can I help you? Please convert XXXVVVIII minimally
Sure! It is 333 using X_V_I
$ python3 roman_arabic.py
How can I help you? Please convert AhZhJ minimally
Sure! It is 691 using Ah_Z_J
$ python3 roman_arabic.py
How can I help you? Please convert BCBC minimally

請加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp




 

標簽:

掃一掃在手機打開當前頁
  • 上一篇:代做CMPSC 443、代寫Project 2: Buffer Overflows
  • 下一篇:INFO-5060代做、代寫C++程序語言
  • 無相關信息
    昆明生活資訊

    昆明圖文信息
    蝴蝶泉(4A)-大理旅游
    蝴蝶泉(4A)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區(qū)
    昆明西山國家級風景名勝區(qū)
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

    關于我們 | 打賞支持 | 廣告服務 | 聯(lián)系我們 | 網站地圖 | 免責聲明 | 幫助中心 | 友情鏈接 |

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    久久久久久精品无码人妻_青春草无码精品视频在线观_无码精品国产VA在线观看_国产色无码专区在线观看

    欧美h视频在线观看| 国产乱子夫妻xx黑人xyx真爽| 少妇高潮毛片色欲ava片| 日韩肉感妇bbwbbwbbw| 日韩精品一区二区免费| 天天影视色综合| 欧美日韩一区二区在线免费观看| 欧美日韩一区二区三区电影| 黄色一级免费大片| 给我免费播放片在线观看| 在线观看日本www| 无码日韩人妻精品久久蜜桃| 日本久久久网站| 日本黄色播放器| 日本在线播放一区二区| 欧美成人免费高清视频| 成年人网站国产| 中国老女人av| 日本一二三区在线| 一级黄色录像在线观看| 成人免费毛片播放| 国产精品沙发午睡系列| 99色这里只有精品| 免费的一级黄色片| 国产又大又长又粗又黄| 欧美一区二区中文字幕| 成人手机在线播放| 欧美 日韩 国产 在线观看| 天天干天天玩天天操| 免费国产成人av| 美女日批免费视频| 色欲色香天天天综合网www| 国产一区 在线播放| 超碰97在线看| 青青草免费在线视频观看| 午夜剧场高清版免费观看| 91制片厂毛片| 欧美黑人又粗又大又爽免费| 欧美牲交a欧美牲交aⅴ免费真| 国产美女在线一区| 天堂8在线天堂资源bt| 神马午夜伦理影院| 天堂av在线中文| 男人添女人下部视频免费| 欧美少妇一区二区三区| av电影一区二区三区| 亚洲精品少妇一区二区| 糖心vlog在线免费观看| 吴梦梦av在线| 在线观看污视频| 亚洲爆乳无码精品aaa片蜜桃| 天堂а√在线中文在线| 国产资源在线免费观看| 欧洲精品在线播放| 人人妻人人添人人爽欧美一区| 日韩av黄色网址| 欧美 日韩 国产 激情| 爱情岛论坛vip永久入口| 特级丰满少妇一级| 爱豆国产剧免费观看大全剧苏畅| 国产传媒免费观看| 黑人巨大国产9丨视频| 男人天堂a在线| av免费观看网| 国产精品久久久久9999小说| 亚洲第一色av| 黑人巨茎大战欧美白妇| www.射射射| 玩弄japan白嫩少妇hd| 国产福利在线免费| 国产精品一二三在线观看| 青青草精品视频在线| 男人插女人下面免费视频| 亚洲女人在线观看| 成人一级生活片| 日韩毛片在线免费看| 17c国产在线| 99热久久这里只有精品| 亚洲人成无码www久久久| 伊人成人222| 亚洲天堂第一区| 六月丁香婷婷激情| 国产成人黄色网址| 日韩一级片一区二区| 超碰在线超碰在线| 国产精品va在线观看无码| 日本精品www| www.国产福利| 大胆欧美熟妇xx| www亚洲成人| 成人在线免费高清视频| 成年人黄色片视频| 浴室偷拍美女洗澡456在线| 阿v天堂2017| 色91精品久久久久久久久| 国产日韩亚洲欧美在线| 福利在线一区二区三区| 男人草女人视频| 欧美日韩在线成人| 欧美大黑帍在线播放| 天堂社区在线视频| 国产精品va在线观看无码| 九九热免费精品视频| 97超碰在线视| 午夜精品久久久久久久99热影院| www.成年人视频| www.精品在线| 欧美日韩一道本| 国产一区一区三区| 久草综合在线观看| www.亚洲成人网| 五月天中文字幕在线| 欧美日本视频在线观看| 国产手机视频在线观看| 日本成人中文字幕在线| 日韩亚洲欧美视频| 奇米视频7777| 国产美女在线一区| 成人短视频在线看| 国产精品区在线| 免费看的黄色大片| www.一区二区.com| 无套内谢丰满少妇中文字幕| 国产一区二区在线免费播放| 91国视频在线| 大胆欧美熟妇xx| 97精品国产97久久久久久粉红| 五月激情婷婷在线| 国产福利一区视频| 日韩xxxx视频| 中文精品无码中文字幕无码专区| 亚洲网中文字幕| 最新国产黄色网址| 国产精品久久久毛片| 欧美v在线观看| 久久黄色片视频| 国产高清av在线播放| 日本a级片在线播放| 国产对白在线播放| 免费黄频在线观看| 最新av免费在线观看| 午夜免费精品视频| 国产在线观看福利| 丝袜老师办公室里做好紧好爽 | 欧美日韩黄色一级片| 国产女教师bbwbbwbbw| 色呦呦网站入口| 日韩 国产 一区| 亚洲妇熟xx妇色黄蜜桃| 爱爱爱爱免费视频| 天堂8在线天堂资源bt| 性一交一乱一伧国产女士spa| 免费观看国产视频在线| 只有这里有精品| 免费看啪啪网站| 手机在线免费毛片| 男同互操gay射视频在线看| 国产91av视频在线观看| 无码人妻精品一区二区三区99v| 精品91一区二区三区| 国产91视频一区| 少妇久久久久久被弄到高潮| 日韩视频 中文字幕| 国产 欧美 日韩 一区| 丰满的少妇愉情hd高清果冻传媒| 真实国产乱子伦对白视频| 国产av熟女一区二区三区 | 福利在线一区二区三区| 久久久久久香蕉| 91精品无人成人www| 日韩欧美亚洲另类| 亚洲日本黄色片| 水蜜桃在线免费观看| 日韩av高清在线看片| 黄色一级大片在线观看| 日日干夜夜操s8| 国产日韩视频在线播放| 日韩精品手机在线观看| xxxx18hd亚洲hd捆绑| 欧美s码亚洲码精品m码| 少妇性l交大片| 91精产国品一二三产区别沈先生| 黑人巨大国产9丨视频| 男人添女人荫蒂免费视频| 国产精品秘入口18禁麻豆免会员| 免费大片在线观看| 亚欧美在线观看| 日本精品免费视频| 777av视频| 亚洲国产成人va在线观看麻豆| 日本一区二区三区四区五区六区| 免费av手机在线观看| 亚洲精品视频导航| 超碰10000| 日本成人在线免费视频| 视频区 图片区 小说区| 国产视频九色蝌蚪| www.99r| www.偷拍.com| 人妻有码中文字幕|