Skip to content

Commit f321127

Browse files
committed
Created a new branch Calculator and added Calculator.java class
1 parent 984adcc commit f321127

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

src/main/java/Student/Calculator.java

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
package Student;
2+
3+
public class Calculator {
4+
public float Add(float a,float b){
5+
return a+b;
6+
}
7+
public float Sub(float a,float b){
8+
return a-b;
9+
}
10+
public float mul(float a,float b){
11+
return a*b;
12+
}
13+
public float div(float a,float b){
14+
if(b==0){
15+
throw new ArithmeticException("Cannot divide by zero");
16+
}
17+
return a/b;
18+
}
19+
}

0 commit comments

Comments
 (0)