Skip to content
Closed
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
19 changes: 19 additions & 0 deletions src/main/java/Student/Calculator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
package Student;

public class Calculator {
public float Add(float a,float b){
return a+b;
}
public float Sub(float a,float b){
return a-b;
}
public float mul(float a,float b){
return a*b;
}
public float div(float a,float b){
if(b==0){
throw new ArithmeticException("Cannot divide by zero");
}
return a/b;
}
}
37 changes: 37 additions & 0 deletions src/main/java/Student/Student.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
package Student;

public class Student {
private String name;
private int roll;
private String dept;

// Setter for name
public void setName(String name) {
this.name = name;
}

// Getter for name
public String getName() {
return this.name;
}

// Setter for Roll
public void setRoll(int roll){
this.roll=roll;
}

// Getter for Roll
public int getRoll(){
return this.roll;
}

// Setter for Department
public void setDept(String dept){
this.dept=dept;
}

// Getter for Department
public String getDept(){
return this.dept;
}
}
Loading