//---------- RunInterface METHOD --------------------------------------------------------------------------------------------------------------------------------------------- public void RunInterface() { string userInput = ""; bool isFinished = false; while (!isFinished) { MainMenu(); userInput = Console.ReadLine(); switch (userInput) { case "1": // Case 1.1 - Display Items DisplayItemCategories(); DisplayItems(items); break; case "2": // Case 1.2 - Go to order menu bool isDone = false; while (!isDone) { PurchaseMenu(); Console.WriteLine(); userInput = Console.ReadLine(); switch (userInput) { case "1": // Case 2.1 - Add Money to Balance Console.WriteLine("Please enter deposit amount (must be an integer)"); userInput = Console.ReadLine(); string addMoneyMessage = items.AddMoney(userInput); Console.WriteLine(addMoneyMessage); break; case "2": // Case 2.2 - Select Items Console.WriteLine(); //blank line Console.WriteLine("Please enter valid product code"); string checkProduct = Console.ReadLine(); Console.WriteLine(); //blank line Console.WriteLine("Please enter desired quantity"); string strQuantityDesired = Console.ReadLine(); int intQuantityDesired = int.Parse(strQuantityDesired); string checkProductMessage = items.PurchaseIndividualItem(checkProduct, intQuantityDesired); Console.WriteLine(checkProductMessage); CateringItem selectedItem = null; foreach (CateringItem item in items.ItemList) { if (item.Code == checkProduct) { selectedItem = item; //allows us to get selected item and pass in below break; } } if (checkProductMessage == "ITEM ADDED TO CART") { items.UpdateBalance(selectedItem, intQuantityDesired); } break; case "3": // Case 2.3 - Complete Transaction TenderChange(); Console.WriteLine("List of purchased items and total cost this transaction:"); Console.WriteLine(); DisplayPurchasesCategories(); string printList = items.PrintPurchases(items.PurchasedItems); Console.WriteLine(printList); Console.WriteLine(); //blank line Console.WriteLine("Total: " + items.TotalCost); Console.WriteLine(); //blank line string checkOut = items.BalanceToZero(); Console.WriteLine(checkOut); Console.WriteLine("Press enter to return to main menu"); Console.ReadLine(); isDone = true; //ends the while loop break; default: Console.WriteLine("Please make a valid selection"); break; } Console.WriteLine(); //blank line } break; case "3": isFinished = true; Console.WriteLine("Press Enter To Exit, Enjoy Your Tasty Tasty Food"); break; default: Console.WriteLine("Please make a valid selection"); break; } Console.WriteLine(); //blank line } }