public static void Count(ICountable c, int maxCount) { for (int i = 0; i < maxCount; i++) { c.IncrementCount(); Console.WriteLine($"{c.GetCountString()}"); } }
public static void Count(ICountable c, int MaxCount) { while (c.GetCount() <= MaxCount) { Console.WriteLine(c.GetCountString() + " " + c.Name); c.IncrementCount(); } }
public static void Count(ICountable c, int maxCount) { for (int i = 1; i <= maxCount; i++) { c.IncrementCount(); Console.WriteLine(c.GetCountString() + " " + c.Name + "\n"); } c.ResetCount(); }
public static void Count(ICountable e, int MaxCount) { int delay = 1000; for (int i = 0; i < MaxCount; i++) { e.IncrementCount(); Console.WriteLine(e.GetCountString()); Thread.Sleep(delay); } CountChuckle.AhAhAh(); Console.WriteLine(" "); }
public static void Count(ICountable c, int maxCount) { //use while to count the number of Countable objects while (maxCount != 0) { c.IncrementCount(); Console.WriteLine(c.GetCountString()); maxCount--; } Console.WriteLine(); //reset the count c.ResetCount(); }