爱情鸟第一论坛com高清免费_91免费精品国自产拍在线可以看_亚洲一区精品中文字幕_男人操心女人的视频

代寫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)-大理旅游
    油炸竹蟲
    油炸竹蟲
    酸筍煮魚(雞)
    酸筍煮魚(雞)
    竹筒飯
    竹筒飯
    香茅草烤魚
    香茅草烤魚
    檸檬烤魚
    檸檬烤魚
    昆明西山國家級風景名勝區
    昆明西山國家級風景名勝區
    昆明旅游索道攻略
    昆明旅游索道攻略
  • 短信驗證碼平臺 理財 WPS下載

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

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

    爱情鸟第一论坛com高清免费_91免费精品国自产拍在线可以看_亚洲一区精品中文字幕_男人操心女人的视频
    <strike id="bfrlb"></strike><form id="bfrlb"><form id="bfrlb"><nobr id="bfrlb"></nobr></form></form>

        <sub id="bfrlb"><listing id="bfrlb"><menuitem id="bfrlb"></menuitem></listing></sub>

          <form id="bfrlb"></form>

            <form id="bfrlb"></form>

              <address id="bfrlb"></address>

              <address id="bfrlb"></address>
              一卡二卡3卡四卡高清精品视频| 欧美日韩第一页| 欧美视频一二三区| 一区二区不卡在线视频 午夜欧美不卡'| 久久精品一区四区| 久久综合久久综合这里只有精品| 亚洲一区二区三区四区视频| 国产精品久久网| 欧美网站在线| 国产一区二区三区四区hd| 欧美午夜不卡影院在线观看完整版免费| 久久综合久色欧美综合狠狠| 欧美在线中文字幕| 亚洲第一页在线| 国产精品视频久久一区| 亚洲最新视频在线| 夜夜精品视频一区二区| 久久久噜噜噜久噜久久| 欧美国产欧美亚洲国产日韩mv天天看完整| 午夜激情久久久| 亚洲激情欧美激情| 久久久精品午夜少妇| 欧美日韩在线视频一区二区| 亚洲国产成人久久综合一区| 久久精品一区二区三区不卡牛牛| 国产精品久久久久久久久久三级| 欧美日韩一区在线观看| 欧美午夜在线观看| 欧美午夜a级限制福利片| 国产精品va| 欧美大片一区| 欧美日韩成人综合| 欧美日韩一区二区国产| 一区二区免费在线视频| 国产精品国产a级| 欧美午夜免费影院| 国产精品日韩一区二区三区| 国产三级欧美三级日产三级99| 国产精品美女久久久久久久| 亚洲欧美日韩在线一区| 亚洲伦理网站| 欧美日韩在线第一页| 亚洲国产成人精品视频| 一本色道久久精品| 国产精品狼人久久影院观看方式| 国产日韩精品入口| 亚洲在线视频一区| 亚洲一二三区在线观看| 欧美+亚洲+精品+三区| 加勒比av一区二区| 午夜精品区一区二区三| 老司机aⅴ在线精品导航| 欧美日韩另类丝袜其他| 欧美怡红院视频一区二区三区| 国产午夜精品视频免费不卡69堂| 国产精品久久久久7777婷婷| 久久久久久久综合| 欧美金8天国| 久久久久久久波多野高潮日日| 国产精品自在欧美一区| 欧美一区二区三区四区夜夜大片| 欧美日韩三级一区二区| 欧美精品一区二区在线观看| 先锋影音一区二区三区| 国产精品综合不卡av| 亚洲国产精品女人久久久| 红桃视频一区| 国产欧美一区二区三区在线看蜜臀| 久久精品中文字幕一区二区三区| 国产精品99久久久久久久女警| 久久久久高清| 中文成人激情娱乐网| 久久久91精品国产一区二区精品| 夜夜嗨av一区二区三区网页| 欧美精品日韩| 日韩天天综合| 亚洲精品美女久久久久| 亚洲精品欧美一区二区三区| 久久亚洲风情| 校园春色国产精品| 亚洲精品乱码久久久久久蜜桃麻豆| 西西人体一区二区| 亚洲欧美一区二区原创| 久久久.com| 香蕉乱码成人久久天堂爱免费| 国产欧美日韩亚洲一区二区三区| 国产精品亚洲第一区在线暖暖韩国| 亚洲人www| 亚洲性视频h| 一区二区三区视频在线播放| 黄色一区二区三区| 国语自产精品视频在线看一大j8| 国产精品网站在线观看| 在线亚洲一区二区| 亚洲色无码播放| 亚洲美女视频| 亚洲综合色视频| 欧美本精品男人aⅴ天堂| 亚洲视频999| 欧美成人午夜| 一色屋精品视频在线观看网站| 亚久久调教视频| 韩国av一区二区三区| 亚洲人成网站色ww在线| 国产婷婷色一区二区三区在线| 一本色道久久| 欧美精品福利在线| 国产日韩欧美视频| 国产精品国产三级国产专播精品人| 在线欧美三区| 欧美国产日韩a欧美在线观看| 国产精品av免费在线观看| 午夜久久久久久| 国产亚洲欧美另类一区二区三区| 亚洲女女做受ⅹxx高潮| 欧美一区二区视频免费观看| 欧美日韩综合不卡| 久久午夜av| 国产一级一区二区| 欧美精品1区| 国产精品久久久久久亚洲调教| 欧美午夜激情在线| 亚洲麻豆av| 亚洲第一视频网站| 亚洲大片在线| 久久视频一区| 国产精品私人影院| 黄色资源网久久资源365| 亚洲日本激情| 国产精品乱码久久久久久| 国产女同一区二区| 久久夜色精品国产欧美乱极品| 国产精品永久在线| 欧美日韩在线高清| 欧美人在线视频| 久久不射网站| 国产亚洲成av人在线观看导航| 欧美11—12娇小xxxx| 欧美日韩亚洲一区在线观看| 在线观看日韩欧美| 欧美在线综合| 国产乱码精品一区二区三区忘忧草| 国产精品久久久久久户外露出| 欧美久久视频| 亚洲国产成人久久综合一区| 国产精品视频网| 1769国产精品| 亚洲视频欧洲视频| 久久一区二区精品| 国产精品视频一| 国产精品一区二区久久久久| 国产一区二区久久久| 欧美母乳在线| 欧美福利视频| 欧美在线免费视频| 欧美在线3区| 亚洲福利在线看| 极品尤物av久久免费看| 国产精品草草| 欧美日韩免费观看一区二区三区| 国产精品国产三级国产专播精品人| 校园激情久久| 欧美日韩国产综合在线| 在线免费精品视频| 国产日韩欧美高清免费| 久热这里只精品99re8久| 亚洲麻豆视频| 国产色综合网| 黄色一区二区三区四区| 午夜精品福利在线观看| 国产精品亚洲一区二区三区在线| 国产午夜精品全部视频播放| 欧美国产日韩一区| 国产欧美一区视频| 国产日韩一区| 黑人操亚洲美女惩罚| 欧美激情中文不卡| 在线成人av.com| 欧美日韩视频一区二区| 亚洲人成人77777线观看| 国产精品一二三视频| 久久成人精品一区二区三区| 亚洲午夜激情网页| 激情欧美亚洲| 欧美三区美女| 欧美日韩精品| 亚洲第一色在线| 欧美激情一区二区三区在线视频观看| 久热这里只精品99re8久| 久久久国产午夜精品| 国产一区二区中文| 国产欧美在线视频| 国产视频自拍一区| 欧美高清日韩| 亚洲国产综合在线看不卡| 久久久久国产精品www| 亚洲小说区图片区| 久久精品免费看| 国产美女精品人人做人人爽| 一区二区高清在线观看|