public static string VerifyPurchaseAnotherProduct(string userInput) { if (userInput.ToLower() == "yes" || userInput.ToLower() == "no") { return(userInput); } else { Console.WriteLine($"\"{userInput}\": is not a valid entry. Please enter yes or no."); ConsoleLogging.PurchaseAnotherProduct(); return(userInput); } }
static void Main(string[] args) { bool complete; do { Console.Clear(); Cart.GetItemDetails(); complete = (ConsoleLogging.PurchaseAnotherProduct() == "no"); } while (complete == false); Console.Clear(); Receipt.PrintReceipt(); }