also stuck on 4.10 -
09-30-2010, 02:15 PM
a. build a clock method named run() that moves the min and hr hand realistically ( each time the min hand completes rotation hr hand moves an hr). define a parameter named speedUp that controls the durations of the hand movements, such that run(0) will make the clock run at normal speed, run (60) will make the clock run at 60 times its normal speed, run (3600) will make the clock run 3600 times its normal speed, and so on.
b. build a clock method setTime (h, m) that sets the clocks time to h:m (m mins after hour h).
c. Build three functions for your clock: one that returns its current time (as a string) one that returns its current hrs value (as a number), and one that returns its current mis value (as a Number).
|