Hallo,
ich habe ein Problem mit diesem Programm:
als Fehler wird mir das vom Terminal ausgegeben:
Rechnen.java:36: cannot find symbol
symbol : variable input
location: class Rechnen
i = input.nextInt();
^
1 error
Kann mir vielleicht jemand weiter helfen?
ich habe ein Problem mit diesem Programm:
Java:
import java.util.Scanner;
public class Rechnen {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
double a;
double b;
double c;
double d;
System.out.println("Eingabe des ersten Zählers ");
a = in.nextInt();
System.out.println("Eingabe des ersten Nenners ");
b = in.nextInt();
System.out.println("Eingabe des zweiten Zählers ");
c = in.nextInt();
System.out.println("Eingabe des zweiten Nenners ");
d = in.nextInt();
double e = a/b;
double f = c/d;
int i = 0;
while (i != 5) {
System.out.println("Geben Sie 1 ein, dann werden die Brüche addiert");
System.out.println("Geben Sie 2 ein, dann werden die Brüche subtrahiert");
System.out.println("Geben Sie 3 ein, dann werden die Brüche multipliziert");
System.out.println("Geben Sie 4 ein, dann werden die Brüche dividiert");
System.out.println("5");
i = input.nextInt();
double g; double h; double j; double k;
if (i == 1) g = e + f;
else if (i == 2) h = e - f;
else if (i == 3) j = e * f;
else if (i == 4) k = e / f;
System.out.println("g");
System.out.println("h");
System.out.println("j");
System.out.println("k");
}
}
}
als Fehler wird mir das vom Terminal ausgegeben:
Rechnen.java:36: cannot find symbol
symbol : variable input
location: class Rechnen
i = input.nextInt();
^
1 error
Kann mir vielleicht jemand weiter helfen?
Zuletzt bearbeitet: