예제 #1
0
 private void addFundsMessage(Car carToRemove)
 {
     Console.WriteLine("Insufficient funds. Please, pay the fee" + carToRemove.Balance);
     try
     {
         double newBalance = Convert.ToDouble(Console.ReadLine());
         if (newBalance >= Math.Abs(carToRemove.Balance))
         {
             int id = carToRemove.Id;
             parking.calculateFee(newBalance, carToRemove);
             parking.removeCar(carToRemove);
             Console.WriteLine("The car with Id " + id + " was successfully removed from parking");
         }
         else
         {
             throw new Exception();
         }
     }
     catch (Exception)
     {
         addFundsMessage(carToRemove);
     }
 }