static void Main(string[] args) { display myDisplay = new display(); while (true) { string choice = showDisplay(myDisplay); switch (choice) { case "1": myDisplay.increaseCount(); break; case "2": myDisplay.decreaseCount(); break; case "3": myDisplay.reset(); break; case "4": Console.WriteLine("Your counter in hex is " + myDisplay.toHex() + "."); break; case "5": Console.WriteLine("Your counter in Binary is " + myDisplay.toBinary() + "."); break; case "6": Console.WriteLine("Exiting Program."); Environment.Exit(0); break; default: break; } } }
public static string showDisplay(display myDisplay) { Console.WriteLine("Your counter is currently at " + myDisplay.toDecimal() + "."); Console.WriteLine("What would you like to do?"); Console.WriteLine("1. Increase counter by 1."); Console.WriteLine("2. Decrease counter by 1."); Console.WriteLine("3. Reset Counter to 0."); Console.WriteLine("4. Display in Hex."); Console.WriteLine("5. Display in Binary."); Console.WriteLine("6. Exit Program."); return Console.ReadLine(); }