Stop show with sound -- Keyboard shortcut: 'x'  Next slide in show -- Keyboard shortcut: 'n'  1 minute, 35 secondsIntroduktion til objekt-orienteret programmering - slide 3 : 31

Eksempel: Struktureret programmering (2) 

 

checkKonto =
record
  id: KontoId;
  balance: Kroner;
  renteSats: Real;
  antalUdnyttedeChecks: Integer;
end
 

 

procedure transaktion(kt: Kontotype);
Type TransaktionsType = (opret, hæve, indsætte, tilskrivRente,
                        clearCheck, nedlaeg);

Procedurer for forskellige typer af transaktioner;

begin
  case kt of
    checkKonto:  checkKontoTransaktion;
    aktionærKonto:  aktionærKontoTransaktion;
    pensionsKonto:  pensionsKontoTransakton;
    gevinstKonto:  gevinstKontoTransaktion;
  end;
end (* transaktion *)