backup
This commit is contained in:
60
11/Konto.~ava
Normal file
60
11/Konto.~ava
Normal file
@@ -0,0 +1,60 @@
|
||||
/**
|
||||
*
|
||||
* Beschreibung
|
||||
*
|
||||
* @version 1.0 vom 06.05.2025
|
||||
* @author
|
||||
*/
|
||||
|
||||
public class Konto {
|
||||
|
||||
// Anfang Attribute
|
||||
private int kontonr;
|
||||
private double kontostand;
|
||||
// Ende Attribute
|
||||
|
||||
public 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 auszahlen(double summe) {
|
||||
if (summe >= 0 && this.kontostand >= summe) {
|
||||
this.kontostand-=summe;
|
||||
}
|
||||
else {
|
||||
System.out.println("Es ist ein Fehler aufgetreten!");
|
||||
} // end of if-else
|
||||
|
||||
|
||||
}
|
||||
|
||||
// Ende Methoden
|
||||
} // end of Konto
|
||||
Reference in New Issue
Block a user