We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ea7fa5a commit d25a7d2Copy full SHA for d25a7d2
src/Features/Calculator.java
@@ -0,0 +1,21 @@
1
+public class Calculator {
2
+
3
+ public double add(double a, double b) {
4
+ return a + b;
5
+ }
6
7
+ public double subtract(double a, double b) {
8
+ return a - b;
9
10
11
+ public double multiply(double a, double b) {
12
+ return a * b;
13
14
15
+ public double divide(double a, double b) {
16
+ if (b == 0.0) {
17
+ throw new IllegalArgumentException("Division by zero");
18
19
+ return a / b;
20
21
+}
0 commit comments