From 15c2e13fda0f36c99cc8854898bca3e2228672b4 Mon Sep 17 00:00:00 2001 From: janik Date: Thu, 21 Oct 2021 12:22:57 +0200 Subject: [PATCH] konto --- 12fi5/AEuP/Konto/konto.ps1 | 40 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 12fi5/AEuP/Konto/konto.ps1 diff --git a/12fi5/AEuP/Konto/konto.ps1 b/12fi5/AEuP/Konto/konto.ps1 new file mode 100644 index 0000000..5b6fb61 --- /dev/null +++ b/12fi5/AEuP/Konto/konto.ps1 @@ -0,0 +1,40 @@ +class konto { + [string]$kontonr + [string]$ktyp + [string]$kunde + [double]$guthaben + [string]$erstelldatum + + konto() { + $this.guthaben = 0 + $this.erstelldatum = Get-Date + } + + [double]einzahlen([double]$menge) { + $this.guthaben += $menge + return $this.guthaben + } + + [double]auszahlen([double]$menge) { + if (($this.guthaben - $menge) -gt (-1000)) { + $this.guthaben -= $menge + } + return $this.guthaben + } + + [void]set_knr([int]$nr){ # public + [string]$this.kontonr = $nr + } + + [string]get_knr(){ # public + return $this.kontonr + } + + [void]set_ktyp($typ){ # public + $this.ktyp = $typ + } + + [string]get_ktyp(){ # public + return $this.ktyp + } +} \ No newline at end of file