ich will das am ende meines programmes ......was mach ich falsch????
public class Bananen {
//konstante Zahl
public static float steuer = 1.07F;
public static void main(String[] args) {
// Deklaration von Variablen
int bruttokilopreis, gewicht;
float bruttopreis, nettopreis;
Scanner in = new Scanner(System.in);
while (true) {
boolean wrongInput = true;
// Wert einlesen
System.out
.println("Geben Sie den Bruttopreis pro kg in Cent ein: ");
bruttokilopreis = in.nextInt();
if (bruttokilopreis < 0) {
System.exit(0);
}
System.out.println("Geben Sie das Gewicht in Gramm ein: ");
gewicht = in.nextInt();
// Umrechnung Cent -> €; g -> Kg
bruttopreis = (bruttokilopreis / 100F) * (gewicht / 1000F);
// Rundung; Komma um 2 Stellen nach rechts verschieben
bruttopreis = Math.round(bruttopreis * 100);
bruttopreis /= 100;
// Ausgabe
System.out.println("Der Bruttopreis beträgt: " + bruttopreis
+ " Euro");
// Steuer vom Bruttopreis rausrechnen
steuer = bruttopreis / steuer;
steuer = Math.round(steuer * 100);
steuer /= 100;
steuer = bruttopreis - steuer;
steuer = Math.round(steuer * 100);
steuer /= 100;
// Ausgabe
System.out.println("Die Mehrwertsteuer beträgt: " + steuer
+ " Euro");
// Subtraktion
nettopreis = bruttopreis - steuer;
nettopreis = Math.round(nettopreis * 100);
nettopreis /= 100;
// Ausgabe
System.out.println("Der Nettopreis beträgt: " + nettopreis
+ " Euro");
// Programmende oder Neustart
while (wrongInput) {
System.out
.println("Wollen Sie eine neue Rechnung durchführen? 'y' oder 'n' ");
String input = in.next();
if ("n".equals(input))
System.exit(0);
else if ("y".equals(input))
wrongInput = false;
else System.out.println("Falsche Eingabe");
}
}
}
}