From bf03e98bc9732f4f4cadc297f03b03fd111b9112 Mon Sep 17 00:00:00 2001 From: "Md. Zunaied Nudar" Date: Thu, 21 Aug 2025 18:36:13 +0600 Subject: [PATCH 1/4] Student.java added --- Student.java | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 Student.java diff --git a/Student.java b/Student.java new file mode 100644 index 00000000..07938aa6 --- /dev/null +++ b/Student.java @@ -0,0 +1,37 @@ +public class Student { + private String name; + private int roll; + private String dept; + private String batch; + + // DEFAULT CONSTRUCTOR + public Student() {} + + // PARAMETERIZED CONSTRUCTOR + public Student(String name, int roll, String dept, String batch) { + this.name = name; + this.roll = roll; + this.dept = dept; + this.batch = batch; + } + + // COPY CONSTRUCTOR + public Student(Student student) { + this.name = student.getName(); + this.roll = student.getRoll(); + this.dept = student.getDept(); + this.batch = student.getBatch(); + } + + // GETTERS + public String getName() { return name; } + public int getRoll() { return roll; } + public String getDept() { return dept; } + public String getBatch() { return batch; } + + // SETTERS + public void setName(String name) { this.name = name; } + public void setRoll(int roll) { this.roll = roll; } + public void setDept(String dept) { this.dept = dept; } + public void setBatch(String batch) { this.batch = batch; } +} \ No newline at end of file From 7017e922b49cad5377fbb522060e3f5cb47aea21 Mon Sep 17 00:00:00 2001 From: "Md. Zunaied Nudar" Date: Thu, 21 Aug 2025 18:40:15 +0600 Subject: [PATCH 2/4] Calculator.java added in feature/calculator branch --- Calculator.java | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 Calculator.java diff --git a/Calculator.java b/Calculator.java new file mode 100644 index 00000000..96a56d0d --- /dev/null +++ b/Calculator.java @@ -0,0 +1,10 @@ +public class Calculator { + // ADDITION + public double add(double a, double b) { return a + b; } + // SUBTRACTION + public double sub(double a, double b) { return a - b; } + // MULTIPLICATION + public double mul(double a, double b) { return a * b; } + // DIVISION + public double div(double a, double b) { return a / b; } +} \ No newline at end of file From 72e315eb81c0d2a387960dbc52a492edd96e1098 Mon Sep 17 00:00:00 2001 From: "Md. Zunaied Nudar" Date: Thu, 21 Aug 2025 18:49:54 +0600 Subject: [PATCH 3/4] Conflicting Calculator.java added in the master branch --- Calculator.java | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Calculator.java diff --git a/Calculator.java b/Calculator.java new file mode 100644 index 00000000..41e63464 --- /dev/null +++ b/Calculator.java @@ -0,0 +1,16 @@ +public class Calculator { + // ADDITION + public double add(double a, double b) { return a + b; } + // SUBTRACTION + public double sub(double a, double b) { return a - b; } + // MULTIPLICATION + public double mul(double a, double b) { return a * b; } + // DIVISION + public double div(double a, double b) { + if (b == 0) { + System.out.println("Error: Division by zero!"); + return 0; + } + return a / b; + } +} \ No newline at end of file From 7d4482a4d584033b56c92ed33bdee003c907aeb4 Mon Sep 17 00:00:00 2001 From: "Md. Zunaied Nudar" Date: Thu, 21 Aug 2025 18:59:12 +0600 Subject: [PATCH 4/4] Grade.java added to the feature/grade branch --- Grade.java | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 Grade.java diff --git a/Grade.java b/Grade.java new file mode 100644 index 00000000..236bb9ec --- /dev/null +++ b/Grade.java @@ -0,0 +1,51 @@ +public class Grade { + public String getLetterGrade(int score) { + if (score < 0 || score > 100) { + return "Invalid score"; + } else if (score >= 80) { + return "A"; + } else if (score >= 70) { + return "B"; + } else if (score >= 50) { + return "C"; + } else if (score >= 30) { + return "D"; + } else { + return "F"; + } + } + + public double getGradePoint(int score) { + if (score < 0 || score > 100) { + return -1; + } else if (score >= 80) { + return 4.0; + } else if (score >= 70) { + return 3.0; + } else if (score >= 50) { + return 2.0; + } else if (score >= 30) { + return 1.0; + } else { + return 0.0; + } + } + + public boolean isPassing(int score) { return score >= 30; } + + public String getRemark(int score) { + if (score < 0 || score > 100) { + return "Invalid score"; + } else if (score >= 80) { + return "Excellent"; + } else if (score >= 70) { + return "Good"; + } else if (score >= 50) { + return "Average"; + } else if (score >= 30) { + return "Pass"; + } else { + return "Fail"; + } + } +} \ No newline at end of file