免费一级欧美片在线观看网站_国产一区再线_欧美日本一区二区高清播放视频_国产99久久精品一区二区300

代寫COMP9021、代做Python程序語言

時(shí)間:2024-03-27  來源:  作者: 我要糾錯(cuò)



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

請(qǐng)加QQ:99515681  郵箱:99515681@qq.com   WX:codehelp




 

標(biāo)簽:

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

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

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

    Copyright © 2025 kmw.cc Inc. All Rights Reserved. 昆明網(wǎng) 版權(quán)所有
    ICP備06013414號(hào)-3 公安備 42010502001045

    免费一级欧美片在线观看网站_国产一区再线_欧美日本一区二区高清播放视频_国产99久久精品一区二区300
    不卡av在线免费观看| 欧美午夜一区二区| 91一区二区在线观看| 欧美成人国产一区二区| 亚洲一区二区三区四区在线观看| 国产美女视频一区| 91精品免费在线观看| 一区二区在线观看av| 国产精品自在在线| 欧美一级片在线看| 亚洲一区在线观看视频| 成人av电影免费观看| 久久这里只有精品首页| 日本在线不卡一区| 欧美中文字幕一区二区三区亚洲| 亚洲国产成人在线| 激情图片小说一区| 日韩欧美的一区二区| 亚洲mv在线观看| 色婷婷激情一区二区三区| 中国色在线观看另类| 国产一区欧美二区| 欧美精品一区二区久久久| 日韩精彩视频在线观看| 精品视频在线视频| 一区二区三区免费在线观看| 99久久精品久久久久久清纯| 国产精品私人自拍| 成熟亚洲日本毛茸茸凸凹| 久久久精品国产免大香伊| 精品一区二区三区视频在线观看 | 欧美亚洲高清一区| 亚洲欧美日韩小说| 99re66热这里只有精品3直播| 日本一区二区在线不卡| 国产自产v一区二区三区c| 日韩午夜在线观看视频| 日韩国产在线观看一区| 欧美日韩国产另类不卡| 亚洲电影在线播放| 欧洲亚洲精品在线| 亚洲最色的网站| 日本精品视频一区二区| 一区二区三区中文字幕精品精品 | 久久综合狠狠综合久久激情| 韩国av一区二区三区四区| 精品乱人伦一区二区三区| 老司机午夜精品| 精品国产百合女同互慰| 国产伦精一区二区三区| 国产午夜亚洲精品不卡| 成人性生交大片免费看在线播放| 中文字幕巨乱亚洲| 成人av在线一区二区三区| √…a在线天堂一区| 91在线观看免费视频| 亚洲精品第1页| 欧美色男人天堂| 日韩激情视频网站| 337p粉嫩大胆色噜噜噜噜亚洲 | 欧美三级一区二区| 丝袜亚洲精品中文字幕一区| 欧美一区二区在线不卡| 精久久久久久久久久久| 欧美精彩视频一区二区三区| 99免费精品在线观看| 亚洲一区二区欧美激情| 91麻豆精品91久久久久同性| 精品中文av资源站在线观看| 国产欧美精品在线观看| 91视频国产观看| 一个色妞综合视频在线观看| 欧美丰满一区二区免费视频| 蜜桃91丨九色丨蝌蚪91桃色| 国产清纯白嫩初高生在线观看91| 91日韩精品一区| 亚洲.国产.中文慕字在线| 日韩一区二区视频| 高清beeg欧美| 一区二区三区不卡视频| 日韩写真欧美这视频| 丁香天五香天堂综合| 亚洲美女一区二区三区| 欧美日韩精品一区二区| 麻豆国产精品777777在线| 国产欧美日韩在线| 91国偷自产一区二区三区成为亚洲经典| 亚洲va韩国va欧美va| 久久久久久日产精品| 91香蕉国产在线观看软件| 亚洲va韩国va欧美va精品| wwwwww.欧美系列| 91免费看片在线观看| 免费成人结看片| 国产精品久久久久久久久晋中 | 国产网红主播福利一区二区| 91国偷自产一区二区使用方法| 免费成人结看片| 亚洲欧洲99久久| 91精品免费在线| 成人高清免费观看| 视频一区二区欧美| 亚洲国产精品激情在线观看| 欧美日韩一级片网站| 国产 欧美在线| 亚洲成a天堂v人片| 国产亚洲人成网站| 欧美影院一区二区| 国产精品一级二级三级| 亚洲成a人片在线观看中文| 国产日本亚洲高清| 欧美二区在线观看| 99国产精品国产精品毛片| 美女视频一区在线观看| 日韩美女久久久| 337p粉嫩大胆色噜噜噜噜亚洲| 在线观看免费成人| 国产成人精品亚洲午夜麻豆| 日本中文一区二区三区| 亚洲色图20p| 久久毛片高清国产| 欧美三级韩国三级日本三斤| 成人精品高清在线| 麻豆精品视频在线观看视频| 亚洲激情五月婷婷| 国产欧美日本一区视频| 日韩免费看的电影| 欧洲激情一区二区| 国产91精品入口| 麻豆精品国产传媒mv男同| 亚洲精品第一国产综合野| 欧美激情综合在线| 日韩美女在线视频| 欧美少妇一区二区| 91在线国产福利| 国产成人丝袜美腿| 久久97超碰国产精品超碰| 午夜亚洲国产au精品一区二区| 国产精品久久久久一区二区三区共| 日韩精品一区二区三区蜜臀| 欧美三级电影在线看| 色婷婷综合五月| 成年人国产精品| 国产精品77777竹菊影视小说| 秋霞影院一区二区| 午夜久久久久久电影| 亚洲一区二区精品视频| 樱桃国产成人精品视频| 国产精品传媒在线| 中文字幕成人av| 国产婷婷一区二区| 精品欧美黑人一区二区三区| 欧美久久久久免费| 欧美日韩精品久久久| 在线观看91视频| 在线观看视频91| 在线观看日韩精品| 色综合久久综合中文综合网| 波多野结衣在线aⅴ中文字幕不卡| 国产精品资源站在线| 国精产品一区一区三区mba桃花 | 欧美一级高清片| 宅男噜噜噜66一区二区66| 欧美三级日本三级少妇99| 在线观看亚洲精品| 日本大香伊一区二区三区| 91亚洲精品一区二区乱码| 91在线视频免费91| 99久久精品免费| 91农村精品一区二区在线| 97久久精品人人做人人爽50路| av中文字幕一区| 国产成人自拍网| 国产麻豆精品一区二区| 国产一区二区三区| 国产成人精品亚洲777人妖| 国产精品123区| 国产传媒日韩欧美成人| 成人在线视频首页| 成人激情校园春色| 91在线播放网址| 91美女在线观看| 91搞黄在线观看| 欧美日韩精品欧美日韩精品一综合| 欧美日韩不卡在线| 91精品国产色综合久久不卡电影| 欧美一级生活片| 久久综合九色综合欧美亚洲| 久久看人人爽人人| 亚洲国产成人自拍| 亚洲日本欧美天堂| 亚洲国产精品一区二区www在线| 亚洲成人三级小说| 蜜桃视频免费观看一区| 国产在线视频精品一区| 成人午夜看片网址| 色综合色狠狠天天综合色| 欧美日韩www| 欧美电影免费观看完整版| 久久久av毛片精品|