00001 using System; 00002 00006 public class SavingsAccount: BankAccount { 00007 00013 public SavingsAccount(string o, double ir): 00014 base(o, 0.0M, ir) { 00015 } 00016 00022 public SavingsAccount(string o, decimal b, double ir): 00023 base(o, b, ir) { 00024 } 00025 00030 public override void Withdraw (decimal amount) { 00031 if (amount < balance) 00032 balance -= amount; 00033 else 00034 throw new Exception("Cannot withdraw"); 00035 } 00036 00041 public override void AddInterests() { 00042 balance = balance + balance * (decimal)interestRate 00043 - 100.0M; 00044 } 00045 00050 public override string ToString() { 00051 return owner + "'s check account holds " + 00052 + balance + " kroner"; 00053 } 00054 }