00001 using System; 00002 00006 public class LotteryAccount: BankAccount { 00007 00008 private static Lottery lottery = Lottery.Instance(20); 00009 00014 public LotteryAccount(string o, decimal b): 00015 base(o, b, 0.0) { 00016 } 00017 00022 public override void AddInterests() { 00023 int luckyNumber = lottery.DrawLotteryNumber; 00024 balance = balance + lottery.AmountWon(luckyNumber); 00025 } 00026 00031 public override string ToString() { 00032 return owner + "'s lottery account holds " + 00033 + balance + " kroner"; 00034 } 00035 }