首页 > > 详细

data课程作业代做、c++,Java程序设计作业代做、代写Python语言作业 代写留学生 Statistics统计、回归、迭代|代写Web开发

ASSIGNMENT 2 Part A
Due Tuesday 24/4/20 18:00*
*Late submissions will incur penalties
Build a controller for a microwave.
Take keyboard inputs
For this you MUST use getchar() scanf is not allowed
1. Take the following inputs
Character Meaning
0->9 Digits 0 to 9
s Start cooking
c Cancel Cooking
+ Add 30 seconds
p1 - p5 Change power setting 1 to 5
1 = 20% means 1 second in every 5
3 = 60% means 3 seconds in every 5
5 = 100% means 5 seconds in every 5
d open/close door
Ignore if key entered is not applicable currently
2. Create the following variables (you will need more than these, but must use
these)
a. int cookTimeRemaining
b. char powerSetting
c. char InteriorLamp
d. char doorOpen
e. char heatingElement
Plus any others that you need
3. Do not allow start to be pressed if the door is open.
4. If the door has not been opened after the cook finishes, do not accept any inputs
5. If the door is opened, pause the cook cycle
6. If + is pressed
a. During cook, or before cook add 30s to the clock time.
b. After cook is finished but before the door is opened - ignore
7. If cancel is pressed
a. During the cook - pause cook
b. While not cooking
i. Clear time
ii. Reset power to 5
8. Turn on the lamp
a. When the door is open
b. When cooking
Output the following:
9. Print the heating element status when it changes
10.Print the lamp status when it changes
11.Print the door status when it changes
12.When starting cook, print ‘Cook Started’
13.During cook print every second, print the time remaining
14.When cook completes print “Ready - Enjoy your meal”
To gain 100% you MUST have output that looks like the following 3 examples(Red is
user input)
(anything in blue is a note from me, do not print)
You may add extra output if you think it is relevant.
Ready - Enjoy your meal
+ //program to ignore this
12 //program to ignore this
s //program to ignore this
1:04
552 //program to ignore this
Heating Off
1:03
p //program to ignore this

联系我们 - QQ: 99515681 微信:codinghelp2
© 2014 www.7daixie.com
程序代写网!