.
This commit is contained in:
@ -9,20 +9,32 @@ class konto {
|
||||
[double]$dispo = -1000
|
||||
|
||||
konto([int]$nummer){
|
||||
if ($this.getType() -eq [konto]){
|
||||
throw "Konto ist abstrakt"
|
||||
}
|
||||
$this.nummer = $nummer
|
||||
}
|
||||
|
||||
|
||||
konto([bool]$aktiv){
|
||||
if ($this.getType() -eq [konto]){
|
||||
throw "Konto ist abstrakt"
|
||||
}
|
||||
$this.aktiv
|
||||
}
|
||||
|
||||
konto([int]$nummer,[double]$stand,[kunde]$inhaber){
|
||||
if ($this.getType() -eq [konto]){
|
||||
throw "Konto ist abstrakt"
|
||||
}
|
||||
$this.nummer = $nummer
|
||||
$this.stand = $stand
|
||||
$this.inhaber = $inhaber
|
||||
}
|
||||
|
||||
konto([int]$nummer,[double]$stand,[string]$BIC){
|
||||
if ($this.getType() -eq [konto]){
|
||||
throw "Konto ist abstrakt"
|
||||
}
|
||||
$this.nummer = $nummer
|
||||
$this.stand = $stand
|
||||
$this.BIC = $BIC
|
||||
@ -51,7 +63,6 @@ class konto {
|
||||
write-warning "Ungültige Eingabe"
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[void]überweisen([konto]$zielkonto,[double]$betrag){
|
||||
$this.auszahlen($betrag)
|
||||
@ -61,7 +72,35 @@ class konto {
|
||||
[void]static statische_Methode(){
|
||||
write-host "Ich bin eine statische Methode"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
class girokonto : konto {
|
||||
girokonto([int]$nummer) : base($nummer) {}
|
||||
girokonto([bool]$aktiv) : base($aktiv) {}
|
||||
girokonto([int]$nummer,[double]$stand,[kunde]$inhaber) : base($nummer, $stand, $inhaber) {}
|
||||
girokonto([int]$nummer,[double]$stand,[string]$BIC) : base($nummer, $stand, $BIC) {}
|
||||
}
|
||||
|
||||
class sparkonto : konto {
|
||||
sparkonto([int]$nummer) : base($nummer) {}
|
||||
sparkonto([bool]$aktiv) : base($aktiv) {}
|
||||
sparkonto([int]$nummer,[double]$stand,[kunde]$inhaber) : base($nummer, $stand, $inhaber) {}
|
||||
sparkonto([int]$nummer,[double]$stand,[string]$BIC) : base($nummer, $stand, $BIC) {}
|
||||
}
|
||||
|
||||
class terminkonto : konto {
|
||||
terminkonto([int]$nummer) : base($nummer) {}
|
||||
terminkonto([bool]$aktiv) : base($aktiv) {}
|
||||
terminkonto([int]$nummer,[double]$stand,[kunde]$inhaber) : base($nummer, $stand, $inhaber) {}
|
||||
terminkonto([int]$nummer,[double]$stand,[string]$BIC) : base($nummer, $stand, $BIC) {}
|
||||
}
|
||||
|
||||
class kreditkonto : konto {
|
||||
kreditkonto([int]$nummer) : base($nummer) {}
|
||||
kreditkonto([bool]$aktiv) : base($aktiv) {}
|
||||
kreditkonto([int]$nummer,[double]$stand,[kunde]$inhaber) : base($nummer, $stand, $inhaber) {}
|
||||
kreditkonto([int]$nummer,[double]$stand,[string]$BIC) : base($nummer, $stand, $BIC) {}
|
||||
}
|
||||
|
||||
class kunde{
|
||||
|
||||
@ -70,6 +109,9 @@ class kunde{
|
||||
[konto[]]$kontenliste = @()
|
||||
|
||||
kunde([string]$vorname,[string]$nachname){
|
||||
if ($this.getType() -eq [kunde]){
|
||||
throw "Kunde ist abstrakt"
|
||||
}
|
||||
$this.vorname = $vorname
|
||||
$this.nachname = $nachname
|
||||
$this.erstelleKonto((read-Host "Anzahl Konten"))
|
||||
@ -84,6 +126,10 @@ class kunde{
|
||||
|
||||
}
|
||||
|
||||
class privatkunde : kunde {
|
||||
privatkunde([string]$vorname,[string]$nachname) : base($vorname, $nachname) {}
|
||||
}
|
||||
|
||||
class bankverwaltung{
|
||||
|
||||
$kundenliste = [System.Collections.ArrayList]::New()
|
||||
|
||||
Reference in New Issue
Block a user