public static void Main(string[] args) { DecreasingCounter counter = new DecreasingCounter(20); counter.PrintValue(); counter.Decrement(); counter.PrintValue(); counter.Decrement(); counter.Reset(); counter.PrintValue(); }
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(); }
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(); }
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(); }