Back to notes -- Keyboard shortcut: 'u'  previous -- Keyboard shortcut: 'p'  next -- Keyboard shortcut: 'n'  Slide program -- Keyboard shortcut: 't'    The class CheckAccount.Lecture 7 - slide 29 : 40
Program 2
using System;

public class CheckAccount: BankAccount {

   // Instance variables of BankAccount are inherited

   public CheckAccount(string o, double ir): 
     base(o, 0.0M, ir) {
   }

   public CheckAccount(string o, decimal b, double ir): 
     base(o, b, ir) {
   }

   // Method Balance is inherited
   // Method Deposit is inherited
   // Method AddInterests is inherited

   public override void Withdraw (decimal amount) {
      base.Withdraw(amount);
      if (amount < balance)
         interestRate = -0.10;
   }

   public override string ToString() {
      return owner + "'s check account holds " +
            + balance + " kroner";
   }
}