static void Main(string[] args) { DisplayMessage("\nHello and welcome to my Calculator Assignment with classes!"); Console.ReadKey(); AskUserForNumbers.AskUserForNumberOne(); }
public static int CalculatorContinuation() { bool stayAlive = true; int usefulNumber = 0; do { try { Program.DisplayMessage("\n\nWould you like to continue using the calculator? y/n: "); char continuationChoice = char.ToUpper(Console.ReadKey(true).KeyChar); stayAlive = false; switch (continuationChoice) { case 'Y': Console.Clear(); AskUserForNumbers.AskUserForNumberOne(); break; case 'N': stayAlive = false; break; default: throw new Exception(); } } catch (Exception) { Program.DisplayMessage("\nSomething went wrong, please try again.", ConsoleColor.Red); } } while (stayAlive); return(usefulNumber); }