Hallo!
Ich habe eine frage zu diesem Programm:
das break wird rot markiert...
Wieso??? ???:L
;(
Danke im Voraus!
Ich habe eine frage zu diesem Programm:
Java:
import javax.swing.JOptionPane;
public class Klasse7 {
public static void main(String[] args) {
boolean falsch = true;
String Note = "";
String Punktzahl = JOptionPane.showInputDialog
("Gib DEINE Punktzahl ein! (0 - 100)");
int Punktzahl2 = Integer.parseInt (Punktzahl);
if(Punktzahl2 > 100) break;
if ((Punktzahl2 >= 90) && (Punktzahl2 <= 100))
Note = "sehr gut (1)";
if ((Punktzahl2 >= 75) && (Punktzahl2 < 90))
Note = "gut (2)";
if ((Punktzahl2 >= 60) && (Punktzahl2 < 75))
Note = "befriedigend (3)";
if ((Punktzahl2 >= 40) && (Punktzahl2 < 60))
Note = "ausreichend (4)";
if ((Punktzahl2 >= 20) && (Punktzahl2 < 40))
Note = "mangelhaft (5)";
if ((Punktzahl2 >= 0) && (Punktzahl2 < 20))
Note = "UNGNÜGEND (6)";
if ((Punktzahl2 < 0) || (Punktzahl2 > 100)){
JOptionPane.showMessageDialog
(null, "Du hast dich vertippt!");
falsch = false;
}
if (falsch == true)
JOptionPane.showMessageDialog
(null, "Deine Note ist " + Note);
}
}
das break wird rot markiert...
Wieso??? ???:L
;(
Danke im Voraus!
Zuletzt bearbeitet von einem Moderator: