Question
write some pseudocode to implement an alarm clock. Your application should set the alarm clock to go off and beep one time in 4 seconds;
write some pseudocode to implement an alarm clock. Your application should set the alarm clock to go off and beep one time in 4 seconds; if the user does not respond and press the key to turn it off, then the alarm should go off and beep two times in another 8 seconds. Continuing the pattern, the alarm should go off in 16 seconds (beep 3 times), 32 seconds (beep 4 times), and 64 seconds (beep 5 times), if no response is received. After five times, the program should terminate. To make a beep, you can print a -g character to stdout. To insert a -g character into a printf statement using the vim editor, for instance, you can use the escape character -v, followed by -g. Alternatively, your code can just print the word "BEEP" if the lab is full and you don't want to annoy the people
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started