public static void SugarChoice() { Console.WriteLine("\nWould you like Sugar?"); extrasChoice = Console.ReadKey().KeyChar.ToString().ToLower(); if (extrasChoice == "y") { Console.WriteLine("You have selected with Sugar"); Ingredients.bSugar = true; } else { Console.WriteLine("No Sugar Selected"); } Extras.MilkChoice(); }
public static void menu() { Console.WriteLine("Drinks Machine 9000"); Dictionary <int, string> dict = new Dictionary <int, string>() { { 1, "Tea" }, { 2, "Coffee" }, { 3, "Quit" } }; foreach (KeyValuePair <int, string> item in dict) { Console.WriteLine("Key: {0}, {1}", item.Key, item.Value); } userInput = MethodLib.GetUserInputByte("Please choose an item:\n"); do { switch (userInput) { case 1: Ingredients.drinksChoice = "Tea"; --Ingredients.Cups; --Ingredients.Tea; Program.DrinksChoice(); Extras.SugarChoice(); break; case 2: Ingredients.drinksChoice = "Coffee"; --Ingredients.Cups; --Ingredients.Coffee; Program.DrinksChoice(); Extras.SugarChoice(); break; case 3: MethodLib.Quit(); break; default: break; } Console.ReadKey(); } while (userInput != 4); }