backup
This commit is contained in:
73
14/12/Konto.java
Normal file
73
14/12/Konto.java
Normal file
@@ -0,0 +1,73 @@
|
||||
/**
|
||||
*
|
||||
* Beschreibung
|
||||
*
|
||||
* @version 1.0 vom 06.05.2025
|
||||
* @author
|
||||
*/
|
||||
|
||||
public class Konto {
|
||||
|
||||
// Anfang Attribute
|
||||
private int kontonr;
|
||||
private double kontostand;
|
||||
private String IBAN;
|
||||
private boolean begrenzteÜberweisung;
|
||||
// Ende Attribute
|
||||
|
||||
protected Konto(int kontonr, double kontostand) {
|
||||
this.kontonr = kontonr;
|
||||
this.kontostand = kontostand;
|
||||
}
|
||||
|
||||
// Anfang Methoden
|
||||
public int getKontonr() {
|
||||
return kontonr;
|
||||
}
|
||||
|
||||
public void setKontonr(int kontonrNeu) {
|
||||
kontonr = kontonrNeu;
|
||||
}
|
||||
|
||||
public double getKontostand() {
|
||||
return kontostand;
|
||||
}
|
||||
|
||||
public void setKontostand(double kontostandNeu) {
|
||||
kontostand = kontostandNeu;
|
||||
}
|
||||
|
||||
public void einzahlen(double summe) {
|
||||
if (summe >= 0) {
|
||||
this.kontostand+=summe;
|
||||
}
|
||||
else {
|
||||
System.out.println("Es ist ein Fehler aufgetreten!");
|
||||
}
|
||||
|
||||
}
|
||||
public void überweisen(double summe, String IBAN) {
|
||||
// TODO hier Quelltext einfügen
|
||||
|
||||
}
|
||||
|
||||
public String getIBAN() {
|
||||
return IBAN;
|
||||
}
|
||||
|
||||
public boolean getBegrenzteÜberweisung() {
|
||||
return begrenzteÜberweisung;
|
||||
}
|
||||
|
||||
public void auszahlen(double summe) {
|
||||
if (summe >= 0 && kontostand >= summe) {
|
||||
this.kontostand-=summe;
|
||||
}
|
||||
else {
|
||||
System.out.println("Es ist ein Fehler aufgetreten!");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Ende Methoden
|
||||
} // end of Konto
|
||||
Reference in New Issue
Block a user