99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

合肥生活安徽新聞合肥交通合肥房產(chǎn)生活服務(wù)合肥教育合肥招聘合肥旅游文化藝術(shù)合肥美食合肥地圖合肥社保合肥醫(yī)院企業(yè)服務(wù)合肥法律

COMP1117B代做、代寫Python編程設(shè)計(jì)

時(shí)間:2024-05-02  來源:合肥網(wǎng)hfw.cc  作者:hfw.cc 我要糾錯(cuò)



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.

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
















 

掃一掃在手機(jī)打開當(dāng)前頁
  • 上一篇:代寫EECS 113、Python/Java程序代做
  • 下一篇:CS 412代做、代寫Python設(shè)計(jì)程序
  • 無相關(guān)信息
    合肥生活資訊

    合肥圖文信息
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    急尋熱仿真分析?代做熱仿真服務(wù)+熱設(shè)計(jì)優(yōu)化
    出評(píng) 開團(tuán)工具
    出評(píng) 開團(tuán)工具
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    挖掘機(jī)濾芯提升發(fā)動(dòng)機(jī)性能
    海信羅馬假日洗衣機(jī)亮相AWE  復(fù)古美學(xué)與現(xiàn)代科技完美結(jié)合
    海信羅馬假日洗衣機(jī)亮相AWE 復(fù)古美學(xué)與現(xiàn)代
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士4號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士3號(hào)線
    合肥機(jī)場(chǎng)巴士2號(hào)線
    合肥機(jī)場(chǎng)巴士2號(hào)線
    合肥機(jī)場(chǎng)巴士1號(hào)線
    合肥機(jī)場(chǎng)巴士1號(hào)線
  • 短信驗(yàn)證碼 豆包 幣安下載 AI生圖 目錄網(wǎng)

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

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

    99爱在线视频这里只有精品_窝窝午夜看片成人精品_日韩精品久久久毛片一区二区_亚洲一区二区久久

          9000px;">

                欧美日韩在线综合| 欧美日韩一级黄| 亚洲不卡av一区二区三区| 欧美日韩视频专区在线播放| www.久久久久久久久| 丁香婷婷综合网| 成人国产在线观看| 欧美综合在线视频| 欧美亚州韩日在线看免费版国语版| 91成人免费在线| 99re6这里只有精品视频在线观看| 欧美视频一区二区三区在线观看| 欧美不卡激情三级在线观看| 色婷婷综合久久久中文字幕| 欧美丝袜自拍制服另类| 7777精品伊人久久久大香线蕉超级流畅| 国产精品美女视频| 欧美精品一区二区三区高清aⅴ| 福利一区福利二区| 91国内精品野花午夜精品| 欧美亚洲动漫精品| 久久婷婷一区二区三区| 五月开心婷婷久久| 国产东北露脸精品视频| 日本电影欧美片| 欧美精品18+| 久久久精品日韩欧美| 中文字幕在线一区二区三区| 亚洲国产一区二区视频| 欧美日韩在线播放| 国产综合久久久久久鬼色| 国产精品理伦片| 欧美美女一区二区在线观看| 裸体健美xxxx欧美裸体表演| 国产女人水真多18毛片18精品视频| 欧美tickle裸体挠脚心vk| 亚洲一区二区三区国产| 欧美视频三区在线播放| 亚洲综合偷拍欧美一区色| 欧美va亚洲va香蕉在线| 亚洲精品国产视频| 国产成人小视频| 国产精品二区一区二区aⅴ污介绍| 欧美午夜一区二区三区| 国产精品短视频| 在线观看亚洲精品视频| 久久电影网电视剧免费观看| 日韩一区二区免费在线电影| 国产一区二区在线观看免费| 性欧美大战久久久久久久久| 免费在线视频一区| 成人动漫中文字幕| 精品一区二区在线免费观看| 亚洲美女屁股眼交| 亚洲日本乱码在线观看| 成人国产电影网| 成人精品高清在线| www.亚洲国产| 99精品久久久久久| 91国产免费观看| 欧美日韩精品综合在线| 欧美日韩一卡二卡三卡| 欧美中文字幕一区| 欧美一级日韩免费不卡| 精品久久一二三区| 久久精品欧美一区二区三区麻豆 | 波多野结衣中文字幕一区| 日韩午夜激情av| 91亚洲国产成人精品一区二区三| 亚洲一区av在线| 国产在线精品视频| 在线综合视频播放| 色偷偷久久人人79超碰人人澡| 中文字幕av在线一区二区三区| 国产女人aaa级久久久级| 国内成人免费视频| 欧美日韩大陆一区二区| 中文字幕国产一区| 成人午夜私人影院| 中文字幕第一区二区| 国产成人综合在线| 久久亚洲春色中文字幕久久久| 精品国产免费久久| 蜜臀va亚洲va欧美va天堂| 91视频国产观看| 日韩理论片中文av| 91一区一区三区| 亚洲综合一区二区三区| 欧美视频日韩视频| 免费成人在线影院| 久久久久久黄色| av综合在线播放| 亚洲激情av在线| 在线播放欧美女士性生活| 美女视频网站久久| 国产亚洲一区二区三区四区| eeuss鲁片一区二区三区在线观看 eeuss鲁片一区二区三区在线看 | 久久午夜国产精品| 韩国欧美一区二区| 国产精品国产a| 91同城在线观看| 亚洲国产欧美日韩另类综合| 欧美日韩中字一区| 久久99国产精品免费| 中文字幕va一区二区三区| 99久久精品免费看国产| 亚洲成在线观看| 久久亚洲精品国产精品紫薇| 成人免费毛片高清视频| 亚洲在线观看免费| 精品国产凹凸成av人网站| 丰满白嫩尤物一区二区| 亚洲自拍偷拍九九九| 日韩欧美另类在线| 99精品视频在线观看| 免费一区二区视频| 中文字幕中文乱码欧美一区二区 | 国产免费成人在线视频| 97aⅴ精品视频一二三区| 日韩国产精品大片| 国产精品成人免费在线| 精品免费一区二区三区| 99re视频精品| 久久国产麻豆精品| 亚洲国产一二三| 日本一区二区三区四区在线视频| 黄页网站大全一区二区| 亚洲人成在线播放网站岛国| 欧美日韩成人综合天天影院 | 91精品国产综合久久久久久久久久 | 久久无码av三级| 色综合久久综合网| 国产一区二区成人久久免费影院| 日韩免费高清视频| 色诱视频网站一区| 懂色一区二区三区免费观看 | 亚洲国产一区二区三区| 精品人在线二区三区| 91网址在线看| 粗大黑人巨茎大战欧美成人| 日本不卡免费在线视频| 亚洲国产精品一区二区久久 | 亚洲妇熟xx妇色黄| 国产精品二三区| 26uuu色噜噜精品一区| 欧美精品第1页| 日本精品免费观看高清观看| 豆国产96在线|亚洲| 国产一区在线观看视频| 日韩精品电影在线观看| 亚洲高清免费视频| 亚洲精品成人精品456| 中文字幕在线不卡| 国产精品美女久久久久aⅴ| 久久综合九色综合97婷婷女人 | 欧美电影免费观看高清完整版| 日韩成人免费在线| 一区二区在线免费观看| 国产精品久久久久婷婷二区次| 成人免费视频国产在线观看| 激情综合网av| 国内精品国产三级国产a久久| 国产精品福利电影一区二区三区四区| 国产成人亚洲综合色影视| 日韩二区三区四区| 一区二区国产盗摄色噜噜| 欧美日韩在线直播| 91在线看国产| 99在线视频精品| www成人在线观看| 欧美在线综合视频| 91小宝寻花一区二区三区| 国产精品香蕉一区二区三区| 国产一区二区电影| 成人综合婷婷国产精品久久蜜臀 | 欧美性猛片aaaaaaa做受| 色就色 综合激情| 欧美天堂一区二区三区| 欧美性一级生活| 欧美一级理论性理论a| 精品日韩在线观看| 一区视频在线播放| 亚洲最大的成人av| 日本成人在线网站| 国产精品99久久久久久似苏梦涵 | 色综合天天综合网国产成人综合天 | 成年人网站91| 欧美性大战久久久久久久| 日韩视频在线你懂得| 久久精品欧美一区二区三区麻豆| 国产精品沙发午睡系列990531| 中文字幕一区在线观看视频| 亚洲第一综合色| 国产乱码精品一区二区三区av| 99riav久久精品riav| 欧美一区午夜精品| 中文字幕日本乱码精品影院| 日韩av一区二区在线影视| 成人99免费视频| 日韩一区二区精品|