You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

36 lines
804 B

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

package calc;
import calc.operation.Adder;
import calc.operation.Subtractor;
import calc.operation.Multiplier;
import calc.operation.Divider;
import calc.operation.Squarer;
public class Calculator {
// Сложение
public int add(int a, int b) {
return Adder.calculate(a, b);
}
// Вычитание
public int sub(int a, int b) {
return Subtractor.calculate(a, b);
}
// Умножение
public int mul(int a, int b) {
return Multiplier.calculate(a, b);
}
// Деление
public int div(int a, int b) {
return Divider.calculate(a, b);
}
// Дополнительная операция возведение в квадрат
public int square(int a) {
return Squarer.calculate(a);
}
}