alice-teacher Clock world

James Vanderhyde jvanderhyde at benedictine.edu
Tue Nov 30 13:15:09 EST 2010


One way to do this would be to keep variables (properties) in the clock object--one for the minutes and one for the hours. Then create methods to change the time. The methods would change the values of the variables and roll the hands. Then you can create functions to return the values of the variables. As long as the new methods are always used and the rolls are not done manually, the minute and hour variables will stay up to date.

I think this is how I (as a CS professor) would do it, but I don't know if it's the easiest for your students.

James
--
Dr. James Vanderhyde
Math and Computer Science
Benedictine College
jvanderhyde at benedictine.edu
http://vanderhyde.us/~james/pro/



On Nov 30, 2010, at 8:18 AM, Suzanne Smith wrote:

> Hey all,
>  
> I am having my students work on a clock exercise from our book and am struggling on showing them the easiest to understand solution.  We have a clock with move-able min and hour hands.  We have to create functions to return the time the clock is set to.  Any easy way to get the function to return the time?  I cannot think of how to do it since the hands are 'roll'ing around the center point of the face. 
> 
> ©º°¨¨°º©©º°¨¨°º©©º°¨¨°º©©º°¨¨°º©©º°¨¨°º©©º°¨¨°º©
> Suzanne Smith
> Hackensack High School - Mathematics
> =====================================
> 
> _______________________________________________
> alice-teachers mailing list
> alice-teachers at lists.andrew.cmu.edu
> https://lists.andrew.cmu.edu/mailman/listinfo/alice-teachers



More information about the alice-teachers mailing list