using System; /// Clock models a clock that ticks and emits an alert /// every 60 ticks. public class Clock { private int time; // the time /// This is the ''constructor'' (__init__) method, /// which sets the starting values of the variables. /// the initial time for the clock. public Clock(int init_time) { time = init_time; } /// tick increments the clock by one tick public void tick() { time = time + 1; if ((time % 60) == 0 ) { Console.WriteLine("Alert: " + time); } } /// getTime returns the current time. /// the current time public int getTime() { return time; } /// reset resets the clock to a new time /// the time to reset public void reset(int new_time) { time = new_time; } }