public static void AddElectricityToCar(Garage i_Garage) { bool askAgain = false; while (askAgain == false) { try { Console.WriteLine("Please enter license number"); string licenseNumber = Console.ReadLine(); CheckValidityLicenseNumber(licenseNumber); if (i_Garage.IsVehicleExistByLicense(licenseNumber)) { i_Garage.CanCarBeCharged(licenseNumber); Console.WriteLine("Please enter the amount of electricity to add:"); string amountOfElectricity = Console.ReadLine(); i_Garage.AddElectricity(licenseNumber, float.Parse(amountOfElectricity)); Console.WriteLine($@"The vehicle has been charged till: { i_Garage.VehiclesToFix[licenseNumber].VehicleOfOwner.PowerSource.CurrentAmountOfPower}"); } else { PrintTheLicenseDoseNotExist(); } askAgain = true; } catch (FormatException ex) { Console.WriteLine(ex.Message); Console.WriteLine("Please try again."); } catch (ValueOutOfRangeException ex) { Console.WriteLine(ex.Message); Console.WriteLine("Please try again."); } catch (ArgumentException ex) { Console.WriteLine(ex.Message); Console.WriteLine("Please try again."); } } }