public static void Count(ICountable c, int maxCount)
 {
     for (int i = 0; i < maxCount; i++)
     {
         c.IncrementCount();
         Console.WriteLine($"{c.GetCountString()}");
     }
 }
Exemple #2
0
 public static void Count(ICountable c, int MaxCount)
 {
     while (c.GetCount() <= MaxCount)
     {
         Console.WriteLine(c.GetCountString() + " " + c.Name);
         c.IncrementCount();
     }
 }
Exemple #3
0
        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();
        }
Exemple #4
0
        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(" ");
        }
Exemple #5
0
 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();
 }