using System; public class BankAccount { private string owner; private decimal balance; private bool readMode; public BankAccount(string owner, decimal balance) { this.owner = owner; this.balance = balance; this.readMode = true; } public decimal Balance { get {if (readMode){ readMode = false; return balance; } else throw new Exception("Cannot read now!"); } set {if (!readMode){ balance = value; readMode = true; } else throw new Exception("Cannot write now!"); } } public override string ToString() { return owner + "'s account holds " + + balance + " kroner"; } }