overloaded constructors
This commit is contained in:
@ -3,13 +3,26 @@ class konto {
|
|||||||
[string]$ktyp
|
[string]$ktyp
|
||||||
[string]$kunde
|
[string]$kunde
|
||||||
[double]$guthaben
|
[double]$guthaben
|
||||||
[string]$erstelldatum
|
[datetime]$erstelldatum
|
||||||
|
|
||||||
konto() {
|
konto() {
|
||||||
$this.guthaben = 0
|
$this.guthaben = 0
|
||||||
$this.erstelldatum = Get-Date
|
$this.erstelldatum = Get-Date
|
||||||
}
|
}
|
||||||
|
|
||||||
|
konto([string]knr) {
|
||||||
|
$this.guthaben = 0
|
||||||
|
$this.erstelldatum = Get-Date
|
||||||
|
$this.kontonr = knr
|
||||||
|
}
|
||||||
|
|
||||||
|
konto([string]knr, [string]ktyp) {
|
||||||
|
$this.guthaben = 0
|
||||||
|
$this.erstelldatum = Get-Date
|
||||||
|
$this.kontonr = knr
|
||||||
|
$this.ktyp = ktyp
|
||||||
|
}
|
||||||
|
|
||||||
[double]einzahlen([double]$menge) {
|
[double]einzahlen([double]$menge) {
|
||||||
if ($menge -lt 0) {
|
if ($menge -lt 0) {
|
||||||
throw "Einzahlungsmenge muss positiv sein!"
|
throw "Einzahlungsmenge muss positiv sein!"
|
||||||
|
|||||||
Reference in New Issue
Block a user