Example #1
0
        public static void Main(string[] args)
        {
            DecreasingCounter counter = new DecreasingCounter(20);

            counter.PrintValue();

            counter.Decrement();
            counter.PrintValue();
            counter.Decrement();


            counter.Reset();
            counter.PrintValue();
        }
Example #2
0
        public static void Main(string[] args)
        {
            DecreasingCounter counter = new DecreasingCounter(20); // Creates a new object that has a value.

            counter.PrintValue();                                  // Prints the value.
            counter.Decrement();                                   // Decreases the value by 1.

            counter.PrintValue();
            counter.Decrement();
            counter.Decrement();
            counter.PrintValue();
            counter.Reset(); // Resets the value to 0.

            counter.PrintValue();
            counter.Decrement();
        }
Example #3
0
        public static void Main(string[] args)
        {
            DecreasingCounter counter = new DecreasingCounter(11);

            counter.PrintValue();

            counter.Decrement();
            counter.PrintValue();

            counter.Decrement();
            counter.PrintValue();

            Console.WriteLine("After reset");
            counter.Reset();
            counter.PrintValue();

            Console.ReadKey();
        }
Example #4
0
        public static void Main(string[] args)

        {
            DecreasingCounter counter = new DecreasingCounter(1100);

            counter.PrintValue();

            counter.Decrement();

            counter.PrintValue();

            counter.Decrement();

            counter.PrintValue();
            counter.Reset();

            counter.PrintValue();
            Console.ReadLine();
        }