-
Notifications
You must be signed in to change notification settings - Fork 0
/
Student.java
42 lines (36 loc) · 988 Bytes
/
Student.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
/**
* Individual implementation for each student in the CaseCash system
* @author Nikhil Jindal
*/
public class Student {
// the name of the student
private String name;
// the current balance in the student account
private int balance;
// constructor for the Student class
public Student(String name, int balance) {
this.name = name;
this.balance = balance;
}
/**
* Returns the balance the student has in their account
* @return the balance the student has in their account
*/
public int getBalance() {
return this.balance;
}
/**
* Returns the name of the student
* @return the name of the student
*/
public String getName() {
return this.name;
}
/**
* Updates the balance has in their account
* @param newAmount the amount to update the balance by
*/
public void updateBalance(int newAmount) {
this.balance = newAmount;
}
}