首页
网站开发
桌面应用
管理软件
微信开发
App开发
嵌入式软件
工具软件
数据采集与分析
其他
首页
>
> 详细
代写data编程、代做Python程序语言
项目预算:
开发周期:
发布时间:
要求地区:
IRP 1 Coursework 01
Contents
Description 2
Running the program 2
Main menu 3
Menu level 1 3
Menu level 2 3
Menu level 3 3
Washing machine functions 3
heat_water(temperature) 3
add_water(amount) 3
open_drain() 3
close_drain() 3
spin(speed, duration) 4
alternating_spin(duration, repeat) 4
Options 4
water_temp 4
water_amount 4
rotation_speed 4
spin_duration 4
alternating_duration 4
alternating_spin_repeat 4
Wash types 4
Wash cycle 4
Quick wash 5
Standard wash 5
Thorough wash 5
Rinse and spin 5
Spin 5
Default parameters 5
Grading scheme (20 points) 5
Description
This is an individual coursework worth 10% of the entire grade. Each student will fork the project from the gitlab and complete the code themselves by the end of Friday 3rd November.
https://gitlab-student.macs.hw.ac.uk/ouc_3rd_year_assignments/assignements/coursework_01
This is a simple coursework to demonstrate using functions, lists, loops and variables.
This project simulates a simplified washing machine.
You need to create a menu system to control the options for a washing machine, then simulate the wash cycle by displaying appropriate messages.
Your program will use an infinite loop to execute the code, whether the washing cycle completes successfully or is interrupted by the user, your program must always return to the main menu.
Your program must use functions to display and manage the menu options.
Your program must use functions to retrieve user input, you should have different input functions for different types of input (int, float, string etc.).
Your input functions must be stored in the separate file called user_input.py and imported into your washing machine main file.
You may use extra python files to organize your code.
Your code should have sensible names for functions and variables, you should also add comments where appropriate.
All files need to be uploaded to gitlab before the deadline.
For simplicity it can be assumed that the laundry detergent has been added to the water tank already, and that the first batch of water will be soapy. The following washes will be normal water.
The water in the water tank starts at a temperature of 20 degrees. Your program will need to sleep for a period everytime it executes a loop, you should look use the sleep function of the time library.
Running the program
The program will display the main menu, which will allow the user to select the type of wash, wash options and select when to run. When the user selects the “run cycle” option, the program will provide constant status updates about what it is doing and how much progress has been made.
If the user presses any key during the run cycle process, the cycle will stop running and display a message saying “Wash cancelled” before returning to the main menu.
When the machine has completed the wash cycle it will display a “Wash completed” message before returning to the main menu.
Your program should continue looping until it is forcefully closed.
Main menu
The main menu system will list the various types of wash the washing machine can do. After a type has been selected the menu will allow the user to customize the current wash by altering any of the options.
Invalid options should be identified and an error message displayed, and the user should try again.
Menu level 1
This will list the various types of wash available. You can choose to use numbers or letters to select the wash type. When one has been chosen, Menu level 2 should be displayed.
Menu level 2
This will list the various options for the wash cycle, as well as their current value. You can choose to use numbers or letters to select the option type. When one has been chosen, Menu level 3 should be displayed. There are 2 different actions: “back” and “run cycle”. “Back” returns to Menu level 1, “run cycle” starts the wash cycle using the current options.
Menu level 3
This lists the available values for the selected option, it also has a “back” and “save” command. Both actions return to Menu level 3, but the “save” command will update the options with the new value.
Washing machine functions
Your program should use the following Python functions with appropriate parameter types to simulate the washing machine. You may also add your own functions.
heat_water(temperature)
This function will increase the temperature of the water in the water tank, it should loop until the water reaches the desired temperature. Each iteration will increase the temperature by 1 degree, print a message of the current water temperature, and sleep for 100ms (0.1s).
add_water(amount)
This function will transfer the heated water into the washing machine drum, the amount says how much to transfer in total. It should use a loop until the water has been added. The maximum is 10 litres of water, the function should use a loop to add 0.5 litres and sleep for 100ms each iteration.
open_drain()
This function opens the drain of the washing machine so that water can leave the machine drum. It prints a message saying that the drain is open.
close_drain()
This function closes the drain of the washing machine, so that water cannot leave the drum. It prints a message saying that the drain is closed.
spin(speed, duration)
This function loops, saying that the drum is spinning at the specified speed. The duration is in minutes, but for our simulation we are using 0.1s for each minute. So a loop iteration will display the speed, current spin count and remaining spin counts.
alternating_spin(duration, repeat)
The drum will slowly spin clockwise for (duration) times, then stop and spin counterclockwise for (duration) times. This will be repeated (repeat) times. The function will loop (repeat) times, it will have at least one inner loop, which will print a status message and sleep for 0.1s per spin.
For example:
alternating_spin(5, 3) will execute 3 outer loops, each iteration will spin clockwise 5 times, then spin counterclockwise 5 times, each spin will display a message and sleep for 0.1s, so it will take around 3 seconds to finish the whole function.
Options
The options which can be controlled by the user are:
water_temp
Available options are: 20, 30, 40, 50, 60
water_amount
Available options are: 2.5, 5.0, 7.5, 10.0
rotation_speed
Available options are: 400, 500, 600, 700, 800
spin_duration
Available options are: 5, 7, 10, 15
alternating_duration
Available options are: 1, 2, 3, 4, 5, 6, 7, 8, 9, 10
alternating_spin_repeat
Available options are: 5, 6, 8, 10, 15, 20
Wash types
Most wash types will execute the same wash cycle, it is just that different types of wash will execute it a different number of times.
Wash cycle
Close drain, Heat water, Add water, Alternating spin, Spin, open drain, spin
Quick wash
2 cycles
Standard wash
3 cycles
Thorough wash
4 cycles
Rinse and spin
Close drain, Heat water, Add water, Spin, open drain, spin
Spin
open drain, spin
Default option values
water_temp = 20
water_amount = 10.0
rotation_speed = 600
spin_duration = 15
alternating_duration = 3
alternating_spin_repeat = 5
Grading scheme (20 points)
2 points – suitable variable and function names
2 points – input methods for int, float, boolean and string (with exception checking) in the user_input file.
2 points – menu system works (including spelling, various sub options and input validation)
6 points – each wash type works successfully.
6 points – can change each wash option within the available values, changed options effect the wash cycle.
2 points – useful comments and clear, readable code.
软件开发、广告设计客服
QQ:99515681
邮箱:99515681@qq.com
工作时间:8:00-23:00
微信:codinghelp
热点项目
更多
代写dts207tc、sql编程语言代做
2024-12-25
cs209a代做、java程序设计代写
2024-12-25
cs305程序代做、代写python程序...
2024-12-25
代写csc1001、代做python设计程...
2024-12-24
代写practice test preparatio...
2024-12-24
代写bre2031 – environmental...
2024-12-24
代写ece5550: applied kalman ...
2024-12-24
代做conmgnt 7049 – measurem...
2024-12-24
代写ece3700j introduction to...
2024-12-24
代做adad9311 designing the e...
2024-12-24
代做comp5618 - applied cyber...
2024-12-24
代做ece5550: applied kalman ...
2024-12-24
代做cp1402 assignment - netw...
2024-12-24
热点标签
mktg2509
csci 2600
38170
lng302
csse3010
phas3226
77938
arch1162
engn4536/engn6536
acx5903
comp151101
phl245
cse12
comp9312
stat3016/6016
phas0038
comp2140
6qqmb312
xjco3011
rest0005
ematm0051
5qqmn219
lubs5062m
eee8155
cege0100
eap033
artd1109
mat246
etc3430
ecmm462
mis102
inft6800
ddes9903
comp6521
comp9517
comp3331/9331
comp4337
comp6008
comp9414
bu.231.790.81
man00150m
csb352h
math1041
eengm4100
isys1002
08
6057cem
mktg3504
mthm036
mtrx1701
mth3241
eeee3086
cmp-7038b
cmp-7000a
ints4010
econ2151
infs5710
fins5516
fin3309
fins5510
gsoe9340
math2007
math2036
soee5010
mark3088
infs3605
elec9714
comp2271
ma214
comp2211
infs3604
600426
sit254
acct3091
bbt405
msin0116
com107/com113
mark5826
sit120
comp9021
eco2101
eeen40700
cs253
ece3114
ecmm447
chns3000
math377
itd102
comp9444
comp(2041|9044)
econ0060
econ7230
mgt001371
ecs-323
cs6250
mgdi60012
mdia2012
comm221001
comm5000
ma1008
engl642
econ241
com333
math367
mis201
nbs-7041x
meek16104
econ2003
comm1190
mbas902
comp-1027
dpst1091
comp7315
eppd1033
m06
ee3025
msci231
bb113/bbs1063
fc709
comp3425
comp9417
econ42915
cb9101
math1102e
chme0017
fc307
mkt60104
5522usst
litr1-uc6201.200
ee1102
cosc2803
math39512
omp9727
int2067/int5051
bsb151
mgt253
fc021
babs2202
mis2002s
phya21
18-213
cege0012
mdia1002
math38032
mech5125
07
cisc102
mgx3110
cs240
11175
fin3020s
eco3420
ictten622
comp9727
cpt111
de114102d
mgm320h5s
bafi1019
math21112
efim20036
mn-3503
fins5568
110.807
bcpm000028
info6030
bma0092
bcpm0054
math20212
ce335
cs365
cenv6141
ftec5580
math2010
ec3450
comm1170
ecmt1010
csci-ua.0480-003
econ12-200
ib3960
ectb60h3f
cs247—assignment
tk3163
ics3u
ib3j80
comp20008
comp9334
eppd1063
acct2343
cct109
isys1055/3412
math350-real
math2014
eec180
stat141b
econ2101
msinm014/msing014/msing014b
fit2004
comp643
bu1002
cm2030
联系我们
- QQ: 9951568
© 2021
www.rj363.com
软件定制开发网!