Ejemplo n.º 1
0
 public override void MakeWithdrawal(double amount)
 {
     if (currentBalance - amount < 0 && status == Status.Active)
     {
         serviceCharge   = 15;
         currentBalance -= serviceCharge;
         Console.WriteLine("Nothing has been withdrawn because the balance will go under $0, a service fee of " + ExtensionMethods.ToNAMoneyFormat(serviceCharge, true) + " will be taken from your account.\nYour current balance is now " + ExtensionMethods.ToNAMoneyFormat((currentBalance), true) + "\nNumber of withdrawals: " + numberOfWithdrawal);
         status = Status.Inactive;
     }
     else if (status == Status.Inactive)
     {
         Console.WriteLine("Nothing has been withdrawn, your balance is in the negative");
     }
     else
     {
         base.MakeWithdrawal(amount);
         Console.WriteLine("You have successfully withdrawn " + ExtensionMethods.ToNAMoneyFormat(amount, true) + " from your chequing account.\nYour current balance is now " + ExtensionMethods.ToNAMoneyFormat(currentBalance, true) + "\nNumber of withdrawals: " + numberOfWithdrawal);
     }
 }
Ejemplo n.º 2
0
 public override void MakeDeposit(double amount)
 {
     if (currentBalance + amount > 0)
     {
         base.MakeDeposit(amount);
         Console.WriteLine("You have successfully deposited " + ExtensionMethods.ToNAMoneyFormat(amount, true) + " to your chequing account.\nYour current balance is now " + ExtensionMethods.ToNAMoneyFormat(currentBalance, true) + "\nNumber of deposits: " + numberOfDeposit);
         status = Status.Active;
     }
 }