public class Prüfung { boolean bestanden; int anzahlVersuche; double note; Prüfung() { this.bestanden = false; this.anzahlVersuche = 0; this.note = 0.0; } public boolean darfNochmalSchreiben() { if(3 == this.anzahlVersuche) return false; else return true; } //ende Methdoe public void erhöheVersuchsAnzahl() { this.anzahlVersuche ++; } public int anzahlVersuche() { return this.anzahlVersuche; } public boolean bestanden() { return this.bestanden; } public double note() { return this.note; } public void ändereNote(int neueNote) { this.note = neueNote; } public void ändereBestanden(boolean hatBestanden) { this.bestanden = hatBestanden; } } //ende Klasse