P
Prose
Gast
Hi!
ich hätte gerne gewusst wie man diesen code in eine main verpackt->
Falls wer was hat entweder posten oder im ICQ( 230556625) sagen =)
thx prose
ich hätte gerne gewusst wie man diesen code in eine main verpackt->
Code:
public class Bankkonto {
public Bankkonto() {
kontostand = 5.0;
}
public Bankkonto(double betrag) {
kontostand = betrag;
}
public void einzahlen(double betrag) {
kontostand = kontostand + betrag;
}
public void einzahlen(int euros, int cents) {
kontostand = kontostand + euros + cents / 100.0;
}
public void abheben(double betrag) {
kontostand = kontostand - betrag;
}
public boolean equals(Bankkonto konto) {
return kontostand == konto.getKontostand();
}
public double getKontostand() {
return kontostand;
}
public double zinsenVorhersagen(int jahre, double zinssatz) {
double stand = this.kontostand;
for (int i = 1; i <= jahre; i++) {
stand = stand + zinssatz / 100. * stand;
}
return stand;
}
public void ueberweisen(double betrag, Bankkonto empfaenger) {
abheben(betrag);
empfaenger.einzahlen(betrag);
}
private double kontostand;
}
Falls wer was hat entweder posten oder im ICQ( 230556625) sagen =)
thx prose