A specialization of BankAccount for saving purposes. More...
Inherits BankAccount.
Public Member Functions | |
SavingsAccount (string o, double ir) | |
A constructor that constructs a Savings account on the basis of an owner and the interestrate. The balanced defaults to 0.0. | |
SavingsAccount (string o, decimal b, double ir) | |
A constructor that constructs a SavingsAccount on the basis of an owner, balance, and the interestrate. | |
override void | Withdraw (decimal amount) |
Withdraw an amount from the savings account. | |
override void | AddInterests () |
Add the annual interest to the savings account. This may increase the current balance of the account. | |
override string | ToString () |
Return a text string that represents this account for output purposes. |
A specialization of BankAccount for saving purposes.
Definition at line 6 of file savings-account.cs.
SavingsAccount.SavingsAccount | ( | string | o, | |
double | ir | |||
) |
A constructor that constructs a Savings account on the basis of an owner and the interestrate. The balanced defaults to 0.0.
o | The owners name | |
ir | The interestrate |
Definition at line 13 of file savings-account.cs.
SavingsAccount.SavingsAccount | ( | string | o, | |
decimal | b, | |||
double | ir | |||
) |
A constructor that constructs a SavingsAccount on the basis of an owner, balance, and the interestrate.
o | The owners name | |
b | The initial balance of the account | |
ir | The interestrate |
Definition at line 22 of file savings-account.cs.
override void SavingsAccount.AddInterests | ( | ) | [virtual] |
Add the annual interest to the savings account. This may increase the current balance of the account.
Reimplemented from BankAccount.
Definition at line 41 of file savings-account.cs.
References BankAccount.balance, and BankAccount.interestRate.
override string SavingsAccount.ToString | ( | ) |
Return a text string that represents this account for output purposes.
Reimplemented from BankAccount.
Definition at line 50 of file savings-account.cs.
References BankAccount.balance, and BankAccount.owner.
override void SavingsAccount.Withdraw | ( | decimal | amount | ) | [virtual] |
Withdraw an amount from the savings account.
amount | The amount withdrawn |
Exception | In case of insufficient funds an exception is thrown |
Reimplemented from BankAccount.
Definition at line 30 of file savings-account.cs.
References BankAccount.balance.