Question: A clock displaying the current time. To set the time, simply press the ON button twice, then read the hour and minute from the user.
- A clock displaying the current time. To set the time, simply press the ON button twice, then read the hour and minute from the user. When ON is pressed one more time, the time is set.
- A pre-set time (hh-mm) to start brewing the coffee
- Three buttons labelled OFF, ON, and PROGRAM:
- When the OFF button is pressed, the machine does nothing other than display the current time.
- When the ON button is pressed, the machine starts brewing coffee.
- When the PROGRAM button is pressed, the machine waits for the pre-set time to begin brewing.
- An automatic sensor that detects whether all the water has been used. Once the water runs out, brewing stops.
- A heating sensor that keeps the coffee at a fixed temperature as long as the button is set to ON or PROGRAM
The machines operation can be described as follows. First, the user adds coffee and water to the machine. If the user presses the ON button, the system begins boiling the water and then mixing it with coffee. The mix goes through the filter into the glass container. If the OFF button is pressed, the machine shuts down and the current time is displayed. If the PROGRAM button is pressed, the machine goes into sleep mode until the preset time is reached. Once its reached, the machine wakes up and makes coffee.
Function beginElectricCoffeeMaker():
WHILE OFF Button is pressed
Display Current Time
ENDWHILE
IF PROGRAM Button is pressed
Wait for PRE-SET TIME
ENABLE Brewing
ENABLE Heating Sensor to keep Coffee Pot Warm
ELSE Enter Sleep Mode
ENDWHILE
IF ON Button is pressed
ENABLE Boiling Water and Mixing Coffee
ENABLE Sensor for WATER LEVEL
ENDIF
WATER LEVEL is too low
IF ON Button is pressed twice
Read Hour and Minute from user (hh-mm)
Else ON Button Pressed Time is Set
Machine Displays Correct Time
ENDWHILE
Can someone help me with my pseudocode? I would like to expand on the code that I have already written. Please.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
