-
Notifications
You must be signed in to change notification settings - Fork 0
/
Student.java
81 lines (72 loc) · 1.56 KB
/
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
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
/**
* The 'Student' class represents a student with an id, name, and course and
* can view a transcript of their grades.
*/
public class Student {
/**
* The student's ID number.
*/
private String id;
/**
* The student's name.
*/
private String name;
/**
* The student's course of study.
*/
private Course course;
/**
* Constucts a new Student object with an ID, name and course.
*
* @param _id The ID number of the student.
*/
public Student(String _id) {
this.id = _id;
}
/**
* Prints out a student transcript.
*/
public void getTranscript() {
Transcript.displayTranscript(this);
}
/**
* Returns the student's ID number.
*
* @return Student's ID.
*/
public String getId() {
return this.id;
}
/**
* Returns the student's name.
*
* @return Student's name.
*/
public String getName() {
return this.name;
}
/**
* Returns the name of student's course of study.
*
* @return The name of student's course of study.
*/
public String getCourseName() {
return this.course.getName();
}
/**
* Returns the student's course of study.
*
* @return Student's course of study.
*/
public Course getCourse() {
return this.course;
}
/**
* Sets the student's course of study.
*
* @param _course course of study.
*/
public void setCourse(Course _course) {
this.course = _course;
}
}