/// <summary> /// This method returns the heading and allows the user to /// choose a distance unit to convert from and to. It informs /// the consumer of the distance being converted, performs the /// conversion, and displays the result. /// </summary> public void ConvertDistance() { Console.ForegroundColor = ConsoleColor.White; Console.WriteLine("\n Selecting units"); string[] choices = new string[] { FEET, METRES, MILES }; Console.WriteLine($"\n Please select a unit to convert from\n"); int choice = ConsoleHelper.SelectChoice(choices); FromUnit = choices[choice - 1]; Console.WriteLine($"\n You have selected {FromUnit}! "); Console.WriteLine($"\n Please select a unit to convert to\n"); choice = ConsoleHelper.SelectChoice(choices); ToUnit = choices[choice - 1]; Console.WriteLine($"\n You have selected {ToUnit}! "); FromDistance = ConsoleHelper.InputNumberDouble($"\n Please enter the number of" + $" {FromUnit} you wish to convert to {ToUnit} > "); ConsoleHelper.OutputTitle($"\n Converting {FromUnit} to {ToUnit} "); CalculateDistance(); OutputDistance(); }