国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看

合肥生活安徽新聞合肥交通合肥房產生活服務合肥教育合肥招聘合肥旅游文化藝術合肥美食合肥地圖合肥社保合肥醫院企業服務合肥法律

COMP1117B代做、代寫Python編程設計

時間:2024-05-02  來源:合肥網hfw.cc  作者:hfw.cc 我要糾錯



COMP1117B Computer Programming
Assignment 4
Due date: Apr 29, 2024, 23:59
Reminder
This assignment involves a lot of console input/output. You are reminded that the VPL
system on HKU Moodle evaluates your program with a full score under the condition that
your program output is the EXACT MATCH of the expected output. In other words, any
additional or missing space character, newline character, etc., will be treated as errors
during the evaluation of your program. Also, you are suggested to design more test cases on
your own for testing your program.
You are allowed to use any Python built-in functions. However, you cannot import modules other
than those mentioned in this assignment.
Objective
Your client, XYZ Company, provides car rental services. For this assignment, you are to develop
a rental system for the company’s internal management of rental transactions. The system should
allow managers to analyze rental data and query whether a specific car is available for a new
rental.
The techniques we learned in the previous chapters, such as Files, Sets, Dictionaries, and Tuples,
would be useful for handling this assignment.
Import Data from File
The company’s rental transaction data is stored in a text (.txt) file. Each row represents a rental
transaction with the following fields separated by a single space:
• Car ID (e.g., 01)
• Rental Start Date (e.g., 2024-04-15)
• Customer ID (e.g., 001)
• Rental Fee per Day (integer)
• Rental Days (e.g., 5)
For example, a text file (data.txt) with five records has the following content:
01 2024-04-15 001 50 1
08 2024-04-25 002 45 6
01 2024-05-05 001 50 10
01 2024-05-20 003 60 30
15 2024-05-20 002 45 8
2 IN 9
The program should be able to read the file by specifying the name of the data file.
Below is the input and output for loading the file data when the program starts (Text in
bold is user input):
Transaction records to import:
data.txt
Imported 5 transaction(s) to the system.
Notes:
• The program should automatically assign transaction IDs for each line of the transaction
data (the data.txt file). The transaction ID starts with 1 and then increases by 1 for each
row of the records. For example, the assigned ID of the first line of the transaction data
(01 2024-04-15 001 50 1) is 1, then the next line transaction’s ID is 2, and so on
and so forth.
• The program has not been terminated yet.
Hints:
• You might use a dictionary to store the transaction records after reading the .txt file.
• You might use split() to split a string into a list.
Main Menu
After importing course sessions from the file, the system enters the main menu and
reads a user command repeatedly until the user inputs “Exit”. You should implement the
following SIX commands for the system.
The example data.txt file mentioned in the previous section is used for the following cases.
1. Exit
By inputting the command Exit, the program prints "Thank you for using the Car Rental
System. Goodbye!" and terminates.
Transaction records to import:
data.txt
Imported 5 transaction(s) to the system.
Exit
Thank you for using the Car Rental System. Goodbye!
3 IN 9
2. CarTransaction
By inputting the command CarTransaction, the system lists all cars in the rental
transaction records based on the imported data. Prints the car ID and the number of rental
transactions for each car. Sorts the records in ascending order by the Car ID.
Transaction records to import:
data.txt
Imported 5 transaction(s) to the system.
CarTransaction
Here is the rental transaction for the cars:
The Car 01 has been rented 3 time(s).
The Car 08 has been rented 1 time(s).
The Car 15 has been rented 1 time(s).
3. CarHistory | <car_ID>
This command can list the transaction summary of the specific Car ID in the format
shown in the example below. The records should be sorted by the total number of
rental days in descending order. You can assume that no records have the same total
number of rental days.
Total number of rental days is the sum of the rental days made by the <customer_ID> on
<car_ID>.
The records by the same customer should be merged. For example, assuming Customer
001 made two transactions on Car 01 with rental days of 1 and 10 days, respectively, the
total number of rental days for Customer 001 on Car 01 should be 11.
Transaction records to import:
data.txt
Imported 5 transaction(s) to the system.
CarHistory | 01
Here is the rental summary for the Car 01:
Customer 003 30 day(s)
Customer 001 11 day(s)
4. RentalPeriodAnalysis | <start_date> | <end_date>
This command lists all rental transactions’ starting date time within a specific period
(includes the inputted start and end dates). Display the following information for that period
(sort the records in ascending order by the transaction ID):
4 IN 9
Transaction records to import:
data.txt
Imported 5 transaction(s) to the system.
RentalPeriodAnalysis | 2024-04-15 | 2024-04-25
Rental summary record(s) from April 15, 2024 to April 25, 2024:
01 2024-04-15 001 50 1
08 2024-04-25 002 45 6
5. TopSpendCustomers | <number>
This command determines the top customers based on their total spend amount across all
rental transactions. The <number> parameter specifies the maximum number of top
customers to display.
Display the customer ID, total spend amount, and the number of
transactions for each top customer. Sort the records in descending order by total
spend amount. You can assume that no records have the same total spend
amount in the data.
Transaction records to import:
data.txt
Imported 5 transaction(s) to the system.
TopSpendCustomers | 2
Here are the top 2 customer(s) by total spend amount:
Customer 003 has spent $1800 on 1 transaction(s).
Customer 002 has spent $630 on 2 transaction(s).
6. CheckCarAvailability | <car_id> | <rental_start_date> | <days_of_rental>
This command allows the manager to check if a specific car is available or occupied during
a given rental period. If the car was occupied for any part of the date range, even just a
single day, then the entire period is considered occupied. The <car_id> parameter
represents the car's ID to check. The <rental_start_date> parameter represents the
rental start date to check for availability. The <days_of_rental> parameter represents
the number of days lasting for rental.
If the car is not found in the rental transaction records, display the message “The car is not
found.” indicating that the car is not in the previous transaction records.
If the car is found, check whether it is available or occupied based on the rental transaction
records and the attempted rental period.
5 IN 9
Print the message “The Car <ID> is available in this period.” indicates the car is available.
If the car is occupied, print the message “The Car <ID> is occupied in this period.” Then,
print all the occupied days by line (see the example below).
Example 1 Transaction records to import:
data.txt
Imported 5 transaction(s) to the system.
CheckCarAvailability | 01 | 2024-04-20 | 1
The Car 01 is available in this period.
Example 2 Transaction records to import:
data.txt
Imported 5 transaction(s) to the system.
CheckCarAvailability | 01 | 2024-05-08 | 6
The Car 01 is occupied in this period.
The occupied date(s):
2024-05-08
2024-05-09
2024-05-10
2024-05-11
2024-05-12
2024-05-13
Example 3 Transaction records to import:
data.txt
Imported 5 transaction(s) to the system.
CheckCarAvailability | 20 | 2024-05-10 | 1
The car is not found.
Tips:
• The datetime module in Python contains useful functions for handling dates and times.
To use these functions, you need to import the datetime module at the beginning of
your code.
Example: from datetime import datetime, timedelta
• Parsing Dates:
You can use the datetime.strptime() function to parse a string representation of a date into
a datetime value.
Example: date = datetime.strptime("2024-04-15", "%Y-%m-%d")
6 IN 9
• The previous tip, “parsing dates,” is the prerequisite for the functionality of the tips below
on “comparing dates,” “formatting dates,” and “date arithmetic.”
• Comparing Dates:
You can directly compare datetime values using comparison operators
like <, <=, >, >=, ==, and !=.
Example: if start_date <= date <= end_date:
• Formatting Dates:
You can use the strftime() method of a datetime value to format it as a string.
Example:
date = datetime.strptime("2024-04-15", "%Y-%m-%d")
formatted_date = date.strftime("%B %d, %Y") will format the date as
"April 15, 2024".
• Date Arithmetic:
You can perform date arithmetic using the timedelta class from
the datetime module.
Example: new_date = date + timedelta(days=5) will add 5 days to the
variable date.
• We provide the program structure for this assignment on the next page. You can include
these functions in your program and start working from them, or you can also choose to
design your program all from scratch.
7 IN 9
8 IN 9
Implementation Notes
1. You can assume that user inputs and the input file are always valid. That means you
don’t need to consider cases that have not been mentioned in the requirement.
2. Do not print space character at the end of output lines.
3. The input file is used to import data only. Do not modify the input file.
4. You are allowed to use any Python built-in functions. However, you cannot import modules other
than those mentioned in this assignment.
Submission
Submit your program electronically using the Moodle system to Assignment 4 under the
Assignment section. Late submissions will not be accepted.
• Your program must follow the format of the sample input and output strictly.
• The sample input file (data.txt) is included in the evaluation environment for test cases
evaluation. You do not need to upload them.
• You should only submit source code (*.py)
• We will grade your program with another set of input files and test cases (Not limited
to the sample input file data.txt and test cases). That means we will change the input
file and test cases on Moodle after the submission deadline.
Policy on Plagiarism according to the General Office of CS Department
Plagiarism is a very serious academic offence. Students should understand what constitutes
plagiarism, the consequences of committing an offence of plagiarism, and how to avoid it.
As defined in the University's Regulations Governing Conduct at Examinations, plagiarism is
"the unacknowledged use, as one's own, of work of another person, whether or not such
work has been published.", or put it simply, plagiarism is copying (including paraphrasing)
the work of another person (including an idea or argument) without proper
acknowledgement.
In case of queries on plagiarism, students are strongly advised to refer to "What is
Plagiarism?" at https://tl.hku.hk/plagiarism/
If a student commits plagiarism, with evidence after investigation, no matter whether the
student concerned admits or not, a penalty will be imposed:
First Attempt: if the student commits plagiarism (in an assignment/test of a CS course) for
the first time in his/her entire course of study, the student shall be warned in writing and
receive zero mark for the whole assignment or the whole test; if the student does not agree,
s/he can appeal to the BEng(CompSc) Programme Director within a week;
9 IN 9
Subsequent Attempt: if the student commits plagiarism more than once in higher course of
study, the case shall be referred to the Programme Director for consideration. The
Programme Director shall investigate the case and consider referring it to the University
Disciplinary Committee, which may impose any of the following penalties: a published
reprimand, suspension of study for a period of time, fine, or expulsion from the University.
Both the student who copies other's work and the student who offers his/her work for
copying shall be penalized.
Teachers should report plagiarism cases to the General Office for records and the issuing of
warning letters.

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
















 

掃一掃在手機打開當前頁
  • 上一篇:代寫EECS 113、Python/Java程序代做
  • 下一篇:CS 412代做、代寫Python設計程序
  • 無相關信息
    合肥生活資訊

    合肥圖文信息
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真技術服務
    流體CFD仿真分析_代做咨詢服務_Fluent 仿真
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲勞振動
    結構仿真分析服務_CAE代做咨詢外包_剛強度疲
    流體cfd仿真分析服務 7類仿真分析代做服務40個行業
    流體cfd仿真分析服務 7類仿真分析代做服務4
    超全面的拼多多電商運營技巧,多多開團助手,多多出評軟件徽y1698861
    超全面的拼多多電商運營技巧,多多開團助手
    CAE有限元仿真分析團隊,2026仿真代做咨詢服務平臺
    CAE有限元仿真分析團隊,2026仿真代做咨詢服
    釘釘簽到打卡位置修改神器,2026怎么修改定位在范圍內
    釘釘簽到打卡位置修改神器,2026怎么修改定
    2025年10月份更新拼多多改銷助手小象助手多多出評軟件
    2025年10月份更新拼多多改銷助手小象助手多
    有限元分析 CAE仿真分析服務-企業/產品研發/客戶要求/設計優化
    有限元分析 CAE仿真分析服務-企業/產品研發
  • 短信驗證碼 寵物飼養 十大衛浴品牌排行 目錄網 排行網

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

    Copyright © 2025 hfw.cc Inc. All Rights Reserved. 合肥網 版權所有
    ICP備06013414號-3 公安備 42010502001045

    国产人妻人伦精品_欧美一区二区三区图_亚洲欧洲久久_日韩美女av在线免费观看
    国产一区二区久久久| www.久久撸.com| 97国产精品免费视频| 国内精品免费午夜毛片| 亚洲欧美日韩国产成人综合一二三区| 久久久精品国产亚洲| 97干在线视频| 天天操天天干天天玩| 久久精品视频91| 国产精品免费入口| 日日噜噜夜夜狠狠久久丁香五月 | 日本久久久久亚洲中字幕| 99精品欧美一区二区三区| 最新中文字幕久久| 日韩aⅴ视频一区二区三区| 久久精品99久久久香蕉| 亚洲乱码一区二区三区三上悠亚 | 国产精品女人网站| 青青青国产精品一区二区| 精品日本一区二区| 国产精品一区二区三区不卡| 国产成人自拍视频在线观看| 国产精品日韩一区| 欧美精品在欧美一区二区| 国产成人精品在线观看| 人偷久久久久久久偷女厕 | 国产夫妻自拍一区| 日韩av免费看| 日韩一区二区三区国产| 欧美精品一区在线| 麻豆乱码国产一区二区三区 | 日韩国产精品一区二区三区| 久久草.com| 欧美精品做受xxx性少妇| 极品日韩久久| 欧美日韩成人免费| 成人a免费视频| 久久久国产91| 精品日本一区二区| 久久电影一区二区| 日韩欧美三级一区二区| www欧美日韩| 日韩成人手机在线| 成人免费视频a| 国产精品久久波多野结衣| 国产一区二区三区奇米久涩| 在线精品日韩| 国产一区 在线播放| 在线不卡视频一区二区| 免费av在线一区二区| 久久综合网hezyo| 国产欧美日韩视频一区二区三区| 亚洲午夜高清视频| 麻豆视频成人| 99在线视频免费观看| 久久99国产精品自在自在app| 日韩精品一区二区三区不卡| 国产精品日韩欧美| 粉嫩精品一区二区三区在线观看| 国产日韩二区| 综合一区中文字幕| 国产日韩在线一区二区三区| 久久久久久成人精品| 久久亚洲精品欧美| 欧美亚洲色图视频| 蜜臀久久99精品久久久无需会员| 内射国产内射夫妻免费频道| 国产成人亚洲综合91| 秋霞无码一区二区| 久久99精品久久久久久三级| 亚洲xxxx视频| 波多野结衣久草一区| 青青在线视频免费| 中文字幕在线观看一区二区三区| 国产日韩三区| 日韩欧美精品在线不卡| 欧美激情国产日韩精品一区18| 国产一区二区香蕉| 国产精品久久精品国产| av一本久道久久波多野结衣| 欧美精品二区三区四区免费看视频| 亚洲最大福利视频| 国产精品日韩欧美| 国产高清自拍99| 国产精品一区二区三区成人 | 欧美视频小说| 亚洲av首页在线| 欧美大码xxxx| 国产欧美精品一区二区三区介绍 | 久久久神马电影| 日韩不卡av| 欧美激情乱人伦| 91精品视频在线看| 国产一区二区视频在线观看| 日韩免费在线播放| 国产精品久久久久久婷婷天堂 | 欧美在线播放一区二区| 国产精品天天av精麻传媒| 91麻豆天美传媒在线| 日本一区二区在线播放| 在线视频亚洲自拍| 久久久久国产精品免费网站| 久久国产精品电影| 国产精品美女在线观看| 久久精品国产久精国产思思| 国产日产亚洲精品| 欧美二区三区在线| 欧美综合国产精品久久丁香| 人体精品一二三区| 日韩精品综合在线| 久久成人精品一区二区三区| 久久免费视频网站| 116极品美女午夜一级| 欧美大香线蕉线伊人久久国产精品| 插插插亚洲综合网| 国产精品美女在线播放| 99精彩视频在线观看免费| 国产三级精品在线不卡| 国内少妇毛片视频| 黄色a级片免费| 亚洲a成v人在线观看| 久久最新资源网| 久久久久久国产精品一区| 久久66热这里只有精品| 116极品美女午夜一级| 韩国日本不卡在线| 欧美久久在线| 激情视频在线观看一区二区三区| 亚洲一区亚洲二区亚洲三区| 久久久久久久av| 九一国产精品视频| 国产精品丝袜久久久久久消防器材| 91精品久久久久久久| 国严精品久久久久久亚洲影视| 欧美性视频网站| 精品视频一区二区在线| 日韩极品视频在线观看| 色综合久久精品亚洲国产| 久久久久久久久久久久久久久久av| 久久噜噜噜精品国产亚洲综合| 蜜桃传媒视频第一区入口在线看 | 91精品视频免费观看| 国产精华一区二区三区| 国产经典久久久| 视频在线精品一区| 国产精品国三级国产av| 精品久久中出| 国产精品人成电影| 国产精品久久中文| 久久久久一区二区| 久久久久人妻精品一区三寸| 免费黄色福利视频| 免费观看国产精品视频| 欧美二区在线视频| 国产伦精品一区二区三区四区视频 | 夜夜爽www精品| 性色av一区二区咪爱| 日韩美女av在线免费观看| 精品国产av无码一区二区三区| 宅男av一区二区三区| 日本精品二区| 国产欧美一区二区三区四区 | 国产高清精品一区二区| 99久热在线精品视频| 国产精品2018| 97精品国产97久久久久久| 国产成人一区二区三区免费看| 国产精品视频网址| 亚洲一区免费看| 欧美日韩一区综合| 97免费在线视频| 成人在线一区二区| 国产免费一区二区三区在线观看| 欧美精品一区二区三区四区五区 | 国产99久久精品一区二区 夜夜躁日日躁| 久久久久www| 久久久久久成人| 欧美成人第一页| 国产成人精品一区二区三区| 精品国产免费久久久久久尖叫| 国产精品久久精品国产| 国产精品视频久久| 亚洲欧洲免费无码| 亚洲区一区二区三区| 欧美日韩第一页| 日本三级久久久| 欧美一区二区影视| 欧洲精品在线一区| 粉嫩av四季av绯色av第一区| 国产精品一区二区三区在线 | 欧美牲交a欧美牲交aⅴ免费下载| 日本不卡在线观看| 日本中文字幕成人| 日本一区美女| 国产免费裸体视频| av电影一区二区三区| 久久精品人人做人人爽| 国产精品福利观看| 日本三级韩国三级久久| 日韩欧美视频网站|