konto
This commit is contained in:
40
12fi5/AEuP/Konto/konto.ps1
Normal file
40
12fi5/AEuP/Konto/konto.ps1
Normal file
@ -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
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user