Skip to content

Commit f23fb00

Browse files
committed
Changes made to branch from main
1 parent 0f5574a commit f23fb00

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

Calculator.java

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
public class Computer
2+
{
3+
public int add(int a, int b)
4+
{
5+
return a+b;
6+
}
7+
8+
public int subtract(int a, int b)
9+
{
10+
return a-b;
11+
}
12+
13+
public int multiply(int a, int b)
14+
{
15+
return a*b;
16+
}
17+
18+
public int divide(int a, int b)
19+
{
20+
if (b == 0) {
21+
throw new ArithmeticException("Division by zero is not allowed.");
22+
}
23+
return a/b;
24+
}
25+
}

0 commit comments

Comments
 (0)