public static void AddGasToVehicle() { float gasAmountToAdd; string gasAmountAsString; Console.WriteLine("Please enter licence number"); string license = Console.ReadLine(); Console.WriteLine("Please insert a few liters of fuel to fill: "); gasAmountAsString = Console.ReadLine(); FuelEnergy.eTypeOfFuel ChoiceOfFuelType = SelectFuelType(); if (!float.TryParse(gasAmountAsString, out gasAmountToAdd)) { throw new FormatException(); } ObjectOfGarage.AddFulToVehicle(license, gasAmountToAdd, ChoiceOfFuelType); Console.WriteLine("The fuel refill succeeded"); }