fixes
parent
66ab37114a
commit
bf305d907e
|
@ -12,6 +12,16 @@ public class Main {
|
||||||
String operation = scanner.next();
|
String operation = scanner.next();
|
||||||
float number2 = scanner.nextFloat();
|
float number2 = scanner.nextFloat();
|
||||||
System.out.print("Ответ:");
|
System.out.print("Ответ:");
|
||||||
|
String a = "+";
|
||||||
|
String b = "-";
|
||||||
|
String c = "*";
|
||||||
|
String d = ":";
|
||||||
|
String e = "^";
|
||||||
|
|
||||||
|
|
||||||
|
if (operation != a && operation != b && operation != c && operation != d && operation != e) {
|
||||||
|
System.out.println("ошибка");
|
||||||
|
}
|
||||||
|
|
||||||
if (":".equals(operation)) {
|
if (":".equals(operation)) {
|
||||||
if (number2 != 0) {
|
if (number2 != 0) {
|
||||||
|
@ -36,5 +46,9 @@ public class Main {
|
||||||
float multiplication = number1 * number2;
|
float multiplication = number1 * number2;
|
||||||
System.out.println(multiplication);
|
System.out.println(multiplication);
|
||||||
}
|
}
|
||||||
|
if ("^".equals(operation)) {
|
||||||
|
double power = Math.pow(number1, number2);
|
||||||
|
System.out.println(power);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue