Esempio n. 1
0
        static void Main(string[] args)
        {
            // Counter

            // Create Counter class
            // which has an integer property
            // when creating it should have a default value 0 or we can specify it when creating
            // we can Add(number) to this counter another whole number
            // or we can Add() without parameters just increasing the counter's value by one
            // and we can Get() the current value as string
            // also we can Reset() the value to the initial value

            var baseNumber = new Counter(5);

            baseNumber.Add(5);
            Console.WriteLine(baseNumber.GetCounter());

            baseNumber.Add();
            Console.WriteLine(baseNumber.GetCounter());

            Console.WriteLine(baseNumber.GetCounter());

            baseNumber.ResetCouter();
            Console.WriteLine(baseNumber.GetCounter());

            Console.ReadKey();
        }