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