Assignment 4, Spring 2003
This is a lab homework, do not use the submit
utility, send your solution directly to the lab
guy using email or any alternative method
he permits.
For Lab 5 you drew a clock that shows the current time
of day. All you have to do for this assignment is
improve it a little bit to make it into a useful
desktop application.
- Make sure your program for Lab 5 is working and it
correctly draws a clock showing the current time
of day.
- Add a second hand, so that it now has an hour hand,
a minute hand, and a second hand. This makes testing
less tedious as you don't have to wait long to see
something change, and if you have a clean design, it
will be a trivial addition.
- This is the important part: Animate the Clock.
Make it so that the clock continually shows the correct
time, you should see the second hand moving one tick per second
around the clock face. For this, of course you need
a loop that never terminates (control-C will still stop
your program). You will need to use the look_at_the_clock();
function each time round the loop: integer_time()
will always return the same value if you don't do that.
You will also need a small Pause(x) each time
round the loop, there is no point in redrawing the
clock 10,000 times per second when the time only
changes once per second.
- As always, make it look good.