public class Rechner { public static void main(String[] args) { double ergebnis = 0; System.out.print ("Eingabe Zahl 1: "); double zahl1 = Eingabe.leseDouble(); System.out.print ("Eingabe Operator: "); char op = Eingabe.leseCharacter(); System.out.print ("Eingabe Zahl 2: "); double zahl2 = Eingabe.leseDouble(); if (op == '+') { ergebnis = addieren (zahl1, zahl2); } if (op == '-') { ergebnis = zahl1 - zahl2; } if (op == '*') { ergebnis = zahl1 * zahl2; } if (op == '/') { ergebnis = zahl1 / zahl2; } System.out.println("Ergebnis: " + ergebnis); } public static double addieren (double sum1, double sum2) { double result = sum1 + sum2; return result; } }