-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathStudent.java
More file actions
53 lines (49 loc) · 1.35 KB
/
Student.java
File metadata and controls
53 lines (49 loc) · 1.35 KB
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
43
44
45
46
47
48
49
50
51
52
53
public class Student {
private String idNum;
private String lastName;
private String firstName;
private char initial;
private String course;
private int year;
private double balance;
private double prelims;
private double midterms;
private double finals;
public Student() {
idNum = "";
lastName = "";
firstName = "";
initial = '\0';
course = "";
year = 0;
balance = 0.0;
prelims = 0.0;
midterms = 0.0;
finals = 0.0;
}
public Student(String idNum, String lastName, String firstName, char initial, String course, int year, double balance, double prelims, double midterms, double finals) {
this.idNum = idNum;
this.lastName = lastName;
this.firstName = firstName;
this.initial = initial;
this.course = course;
this.year = year;
this.balance = balance;
this.prelims = prelims;
this.midterms = midterms;
this.finals = finals;
}
//get the ID number of student
public String getIDnum () {
return idNum;
}
public String toString() {
//prints student info
return(lastName + ", " + firstName + " " + initial +
"\nID No. " + idNum + " " + course + " " + year +
"\n\nBalance: PHP" + balance +
"\nAmount due for PRELIMS: " + "PHP " + prelims +
"\nAmount due for MIDTERMS: " + "PHP " + midterms +
"\nAmount due for FINALS: " + "PHP " + finals);
}
}