using System; /// /// A specialization of BankAccount. /// public class CheckAccount: BankAccount { /// A constructor that constructs a CheckAccount on the /// basis of an owner and the interestrate /// The owners name /// The interestrate public CheckAccount(string o, double ir): base(o, 0.0M, ir) { } /// A constructor that constructs a CheckAccount on the /// basis of an owner, balance, and the interestrate /// The owners name /// The initial balance of the account /// The interestrate public CheckAccount(string o, decimal b, double ir): base(o, b, ir) { } /// Withdraw an amount from the check account /// The amount withdrawn public override void Withdraw (decimal amount) { balance -= amount; if (amount < balance) interestRate = -0.10; } /// Returns a string which represents the account public override string ToString() { return owner + "'s check account holds " + + balance + " kroner"; } }