-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudentGrades
More file actions
125 lines (108 loc) · 2.81 KB
/
StudentGrades
File metadata and controls
125 lines (108 loc) · 2.81 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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
/**
* This class represents a student.
*/
public class Student {
private String firstName;
private String lastName;
private String id;
private StudentGrades grades;
/**
* This is the constructor for the Student class.
*
* @param firstName The first name of the student.
* @param lastName The last name of the student.
* @param id The ID of the student.
* @param grades The grades of the student.
*/
public Student(String firstName, String lastName, String id, StudentGrades grades) {
this.firstName = firstName;
this.lastName = lastName;
this.id = id;
this.grades = grades;
}
/**
* This is the default constructor for the Student class.
*/
public Student() {
this.firstName = "";
this.lastName = "";
this.id = "";
this.grades = new StudentGrades();
}
/**
* this method overrides the toString method to return the student's information.
*/
@Override
public String toString() {
return "Student{" +
"firstName='" + firstName + '\'' +
", lastName='" + lastName + '\'' +
", id=" + id +
", grades=" + grades.toString() +
'}';
}
/**
* This method returns the first name of the student.
*
* @return The first name of the student.
*/
public String getFirstName() {
return firstName;
}
/**
* This method sets the first name of the student.
*
* @param firstName The first name of the student.
*/
public void setFirstName(String firstName) {
this.firstName = firstName;
}
/**
* This method returns the last name of the student.
*
* @return The last name of the student.
*/
public String getLastName() {
return lastName;
}
/**
* This method sets the last name of the student.
*
* @param lastName The last name of the student.
*/
public void setLastName(String lastName) {
this.lastName = lastName;
}
/**
* This method returns the ID of the student.
*
* @return The ID of the student.
*/
public String getID() {
return id;
}
/**
* This method sets the ID of the student.
*
* @param ID The ID of the student.
*/
public void setID(String id) {
this.id = id;
}
/**
* This method returns the student's grades.
*
* @return The student's grades.
*/
public StudentGrades getGrades() {
return grades;
}
/**
* This method sets the student's grades.
*
* @param grades The student's grades.
*/
public void setGrades(StudentGrades grades) {
this.grades = grades;
}
}