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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!