From f03de6c5bff77149ef2200a1eb5603f4e260c86d Mon Sep 17 00:00:00 2001 From: Akash Biswas Date: Sat, 20 Sep 2025 14:51:56 +0600 Subject: [PATCH 1/3] add student.java file --- Student.java | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 Student.java diff --git a/Student.java b/Student.java new file mode 100644 index 000000000000..f983eb8a3cfe --- /dev/null +++ b/Student.java @@ -0,0 +1,21 @@ +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 int getId(){ + return id; + } + public void setName(String name){ + this.name = name; + } + public void setId(int id){ + this.id = id; + } +} \ No newline at end of file From 48b8cc88e6f62fd05579e8740e641d576e8e05b7 Mon Sep 17 00:00:00 2001 From: Akash Biswas Date: Sat, 20 Sep 2025 14:59:41 +0600 Subject: [PATCH 2/3] add cal.java file --- Calculator.java | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100644 Calculator.java diff --git a/Calculator.java b/Calculator.java new file mode 100644 index 000000000000..9722ded77001 --- /dev/null +++ b/Calculator.java @@ -0,0 +1,20 @@ +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("Division by zero is not allowed."); + } + return (double) a / b; + } +} From cebd3e40c1005d936ef8734e432b0a92b571d4b8 Mon Sep 17 00:00:00 2001 From: Akash Biswas Date: Sat, 20 Sep 2025 15:21:27 +0600 Subject: [PATCH 3/3] modified f/c --- Calculator.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Calculator.java b/Calculator.java index 9722ded77001..29dd75553006 100644 --- a/Calculator.java +++ b/Calculator.java @@ -13,7 +13,7 @@ public int multiply(int a, int b) { public double divide(int a, int b) { if (b == 0) { - throw new IllegalArgumentException("Division by zero is not allowed."); + throw new IllegalArgumentException("Division by zero is not allowed.b can't be zero."); } return (double) a / b; }