I need to add a Continue yes or no command so that it returns the user to the menu if they type yes or says thanks and exits if you type no to this Code
Code:Using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace ConsoleApplication9 { class Program { static ScreenHold() { Console.WriteLine("Press anykey to continue"); Console.ReadKey(); } static string Menu() { string choice = null; Console.WriteLine("\n1...Convert Miles to Kilometres\n"); Console.WriteLine("\n2...Convert Kilometres to Miles\n"); Console.WriteLine("\n3...Exit\n"); ScreenHold(); Console.WriteLine("\nEnter a choice(1,2 or 3)\n"); choice = Console.ReadLine(); return choice; } static double MilesToKilos(double M) { double Kilometres = M * 1.6093; return Kilometres; } static double KilosToMiles(double K) { double Miles = K * 0.62137; return Miles; } static void Main(string[] args) { string ch = null; do { //Clear the screen Console.Clear(); //Display the menu, menu choice stored in ch ch = Menu(); //Test the users choice switch (ch) { case "1": { Console.WriteLine("\nInput Miles to be converted\n"); double M = double.Parse(Console.ReadLine()); //Call the function MilesToKilos from main double answer = MilesToKilos(M * 1.6093); Console.WriteLine("Miles converted to Kilometres is: " + answer + '\n'); Console.WriteLine("\nPress any key to continue\n"); Console.ReadKey(); break; } case "2": { Console.WriteLine("\nInput kilometres to be converted \n"); double K = double.Parse(Console.ReadLine()); //Call the function KilosToMiles from main double answer = KilosToMiles(K * 0.62137); Console.WriteLine("Kilometres converted to Miles is: " + answer + '\n'); Console.WriteLine("\nPress any key to continue\n"); Console.ReadKey(); break; } case "3": { Console.WriteLine("\nProgram exiting...\n"); Console.WriteLine("\nPress any key to continue\n"); Console.ReadKey(); System.Environment.Exit(0); break; } } } while (ch != "3"); } } }