Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/main/java/com/houarizegai/calculator/Calculator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
public class Calculator{
public int add(int a,int b){
return a+b;
}
public int subtract(int a,int b){
return a-b;
}
public int multiply(int a,int b){
return a*b;
}
public double divide(int a,int b){
if(b==0){
throw new IllegalArgumentException("cannot divide by zero");
}
return (double)a/b;
}

}
20 changes: 20 additions & 0 deletions src/main/java/com/houarizegai/calculator/Student.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
public class Student{
private String name;
private int id;

public Student(String name,int id){
this.name=name;
this.id=id;
}

public String getName(){return name;}
public void setName(){
this.name=name;
}
public int getId(){
return id;
}
public void setId(){
this.id=id;
}
}