Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

C# Program using Delegates to create a countdown clock that can be set, paused and restarted by the user. I have seen a lot of

C# Program using Delegates to create a countdown clock that can be set, paused and restarted by the user. I have seen a lot of countdown timers, however none of them allow the user to interact with the clock which is a must. Thanks in advance for the assistance.

* Write a countdown alarm clock program that uses delegates to notify anyone who is interested that the designated amount of time has passed.

* Youll need a class to simulate the countdown clock that accepts a message and a number of seconds to wait (supplied by caller).

* After waiting the appropriate amount of time, the countdown clock should call the delegate and pass the message to any registered observers.

* (When you're calculating the time to wait, remember that Thread.Sleep() takes an argument in milliseconds, and requires a using System.Threading statement.)

* Your countdown clock class should contain a way to create and set the clock appropriate data, a way to start the alarm clock running, a way to pause the alarm clock, a way to resume the countdown, and a way to abort the alarm clock.

* Create an observer class that echoes the received message to the console. Be certain that the event can be published to multiple handlers safely.

* Create a driver that demonstrates your program using at least 3-4 observers along with at least 2-3 different usages of the alarm clock with times in the range 3-10 seconds. Be certain that your driver demonstrates the complete functionality of your alarm clock by exercising each of its methods at least once.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Fundamentals Of Database Systems

Authors: Ramez Elmasri, Shamkant B. Navathe

7th Edition Global Edition

1292097612, 978-1292097619

More Books

Students also viewed these Databases questions