Back to slide -- Keyboard shortcut: 'u'        next -- Keyboard shortcut: 'n'  Annotated program -- Keyboard shortcut: 't'    bank-account/bank-account-properties/bank-account-1.cs - A BankAccount class with a trivial Balance property together with Deposit and Withdraw methods.Lecture 5 - slide 7 : 29
Program 1

using System;

public class BankAccount {

   private string owner;
   private decimal balance;  
                             
   public BankAccount(string owner, decimal balance) {
      this.owner = owner; 
      this.balance = balance;
   }

   public decimal Balance {   
     get {return balance;}
   }       

   public void Deposit(decimal amount){
     balance += amount;
   } 

   public void Withdraw(decimal amount){
     balance -= amount;
   } 

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