A specialization of BankAccount. More...
Inherits BankAccount.
Public Member Functions | |
LotteryAccount (string o, decimal b) | |
Construct a lottery account based on owner o and the initial balance b. | |
override void | AddInterests () |
Add interest to the lottery account. This may be a lot if a drawn lottery number is the winning number. If not, zero interest is added. | |
override string | ToString () |
Return a text string that represents this account for output purposes. | |
Static Private Attributes | |
static Lottery | lottery = Lottery.Instance(20) |
A specialization of BankAccount.
Definition at line 6 of file lottery-account.cs.
LotteryAccount.LotteryAccount | ( | string | o, | |
decimal | b | |||
) |
Construct a lottery account based on owner o and the initial balance b.
o | The owner of the account | |
b | The initial balance of the account |
Definition at line 14 of file lottery-account.cs.
override void LotteryAccount.AddInterests | ( | ) | [virtual] |
Add interest to the lottery account. This may be a lot if a drawn lottery number is the winning number. If not, zero interest is added.
Reimplemented from BankAccount.
Definition at line 22 of file lottery-account.cs.
References Lottery.AmountWon(), BankAccount.balance, Lottery.DrawLotteryNumber, and lottery.
override string LotteryAccount.ToString | ( | ) |
Return a text string that represents this account for output purposes.
Reimplemented from BankAccount.
Definition at line 31 of file lottery-account.cs.
References BankAccount.balance, and BankAccount.owner.
Lottery LotteryAccount.lottery = Lottery.Instance(20) [static, private] |
Definition at line 8 of file lottery-account.cs.
Referenced by AddInterests().