public decimal CurrentBalance = 1000.00m;
public decimal WithdrawCurrentAmount { get; set; }
public decimal MakeWithdraw()
{
Console.WriteLine("How much would you like to withdraw from your Current account?", WithdrawCurrentAmount);
if (WithdrawCurrentAmount < 0)
{
throw new Exception("You cannot withdraw a negative amount" );
}
WithdrawCurrentAmount = Convert.ToDecimal(Console.ReadLine());
CurrentBalance = CurrentBalance - WithdrawCurrentAmount;
Console.WriteLine("\nAvailable Current Balance is now: {0}", CurrentBalance);
return CurrentBalance;
}
Aucun commentaire:
Enregistrer un commentaire