Within one hour, design and implement the behavior of a microwave oven.
It has a numeric keypad and a START button. You are responsible for the logic triggered when any of these buttons is pressed.
- Pressing a numeric key sends your code one digit.
- Pressing START tells your code to start "cooking".
This microwave is not fancy. It cannot be stopped or paused once started. Input cannot be cleared. There is no “quick cook” option.
You are not responsible for building a UI or an interactive application. Write functions that might be called as each button is pressed. Use print statements as a substitute for user feedback.
Print what the display will show after each number press. If receiving the button presses for “1”, “3”, and “5”, your code could print "00:01", "00:13", then "01:35".
While cooking, print what the display will show once a second. After “START” is pressed, your code could print “01:34”, “01:33”, “01:32”, and so on.