Question: This programming language is C++ and this is the previous code that I need help changing. { int TotalCoffeeCost = 0; int numSmallCoffee = 0;

This programming language is C++ and this is the previous code that I need help changing.
{ int TotalCoffeeCost = 0; int numSmallCoffee = 0; int numMediumCoffee = 0; int numLargeCoffee = 0; Console.WriteLine("Welcome to my coffee shop!"); begin: Console.WriteLine("Which size would you like?"); Console.WriteLine("3 - Large, 2 - Medium, 1 - Small"); string UserInput = Console.ReadLine(); switch (UserInput) { case "1": TotalCoffeeCost += 1; numSmallCoffee += 1; break; case "2": TotalCoffeeCost += 2; numMediumCoffee += 1; break; case "3": TotalCoffeeCost += 3; numLargeCoffee += 1; break; default: Console.WriteLine($"Your input \"{UserInput}\" is invalid, please enter 1, 2, or 3."); goto begin; } Console.WriteLine($"You've ordered {numSmallCoffee} Small, {numMediumCoffee} Medium and {numLargeCoffee} Large coffee. Total cost ${TotalCoffeeCost}.00."); decide: Console.WriteLine("Do you want to buy another coffee? Y - Yes, N - No"); string userDecision = Console.ReadLine(); switch (userDecision.ToUpper()) { case "Y": goto begin; case "N": Console.WriteLine($"Thank you for shoppping with us!"); Console.WriteLine($"You've ordered {numSmallCoffee} Small,{numMediumCoffee} Medium and {numLargeCoffee} Large Coffee. Bill Amount = ${TotalCoffeeCost}.00."); break; default: Console.WriteLine($"Your input \"{userDecision}\" is invalid, please enter Y or N."); goto decide;
} }
I. Change goto to loop structure in Lab 5, coffee sell program. Hint: create two Boolean flag variables bool purchaseStatus bool decision Status
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
