private int Calculate(int x, int y, Operation operation) {
switch (operation) {
case Operation.PLUS:
return x + y;
case Operation.MINUS:
return x - y;
case Operation.DIVIDE:
return x / y;
case Operation.MULTIPLY:
return x * y;
case Operation.PERCENT:
double number = x;
double percent = y;
double result = number * (percent / 100);
return (int)Math.Round(result);
case Operation.ERROR:
return -1;
}
return -2;
}
Предоставляю код, который вычисляет проценты, со всем остальным проблем нет. Для примера, вводимое число 500, проценты - 50. И вместо числа 250 выходит 25000. Не могу понять в чём проблема