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
34 changes: 34 additions & 0 deletions Student.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
package com.example.model;

public class Student {
private String id;
private String name;
private int age;
private double gpa;

public Student() {}

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

public String getId() { return id; }
public void setId(String id) { this.id = id; }

public String getName() { return name; }
public void setName(String name) { this.name = name; }

public int getAge() { return age; }
public void setAge(int age) { this.age = age; }

public double getGpa() { return gpa; }
public void setGpa(double gpa) { this.gpa = gpa; }

@Override
public String toString() {
return "Student{id='" + id + "', name='" + name + "', age=" + age + ", gpa=" + gpa + "}";
}
}
29 changes: 29 additions & 0 deletions feature/Calculator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
package com.example.util;

/**
* Simple calculator with basic operations.
*/
public class Calculator {

public double add(double a, double b) {
return a + b;
}

public double subtract(double a, double b) {
return a - b;
}

public double multiply(double a, double b) {
return a * b;
}

/**
* Division — throws IllegalArgumentException if divisor is zero.
*/
public double divide(double a, double b) {
if (b == 0.0) {
throw new IllegalArgumentException("Division by zero");
}
return a / b;
}
}