We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 338066e commit 8cee71aCopy full SHA for 8cee71a
src/main/java/com/thealgorithms/calculator.java
@@ -0,0 +1,23 @@
1
+package com.thealgorithms;
2
+
3
+public class calculator {
4
+ public int add(int a, int b) {
5
+ return a + b;
6
+ }
7
8
+ public int subtract(int a, int b) {
9
+ return a - b;
10
11
12
+ public int multiply(int a, int b) {
13
+ return a * b;
14
15
16
+ public double divide(double a, double b) {
17
+ if (b == 0) {
18
+ throw new IllegalArgumentException("Division by zero is not allowed");
19
20
+ return a / b;
21
22
23
+}
0 commit comments