forked from Labore/PR2-L
1
0
Fork 0
PR2-L/SeparateUI_Logic/src/UI.java

36 lines
813 B
Java

import java.util.Scanner;
public class UI {
private static int zahl1;
private static int zahl2;
private static String operator;
public static void main(String[] args) throws Exception {
eingabe();
ausgabe();
}
public static void eingabe() {
Scanner sc = new Scanner(System.in);
System.out.print("1. Zahl eingeben: " );
zahl1 = sc.nextInt();
System.out.print("2. Zahl eingeben: " );
zahl2 = sc.nextInt();
sc.nextLine();
System.out.print("Operand (+/-/*/:): " );
operator = sc.nextLine();
}
public static void ausgabe() {
Logic c = new Logic(zahl1, zahl2);
int ergebnis = c.calculate(operator);
System.out.println("Das Ergebnis ist: " + ergebnis);
}
}