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
25 changes: 25 additions & 0 deletions Calculator.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
public class Computer
{
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 int divide(int a, int b)
{
if (b == 0) {
throw new ArithmeticException("Division by zero is not allowed.");
}
return a/b;
}
}
43 changes: 43 additions & 0 deletions Student.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
public class Attendance
{
private int age;
private String name;

public Attendance()
{
this.age=0;
this.name="";
}

public Attendance(int age, String name)
{
this.age=age;
this.name=name;
}

public int getAge()
{
return age;
}

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

public String getName()
{
return name;
}

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

@Override
public String toString()
{
return "Student{name='"+name+"', age=" +age+ "}";
}
}
Loading