-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStudent.java
More file actions
68 lines (59 loc) · 1.7 KB
/
Copy pathStudent.java
File metadata and controls
68 lines (59 loc) · 1.7 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
// --== CS400 File Header Information ==--
// Name: David Wissink
// Email: dwissink@wisc.edu
// Team: BA
// Role: Backend Developer 2
// TA: Brianna Cochran
// Lecturer: Gary Dahl
// Notes to Grader: None
public class Student{
private Integer studentID;
private String location;
private String status;
//Constructor for Student objects, takes as input the Integer student ID,
//the student's location, and their status
public Student(Integer sID, String loc, String stat) {
this.studentID = sID;
this.location = loc;
this.status = stat;
}
//Default constructor for Student object that takes no arguments, sets ID to 0,
//and both location and status to NA
public Student() {
this.studentID = 0;
this.location = "NA";
this.status = "NA";
}
//Updates ID field to newID
public void setID(Integer newID) {
studentID = newID;
return;
}
//Updates location field to newLoc
public void setLocation(String newLoc) {
location = newLoc;
return;
}
//Updates status field to newStat
public void setStatus(String newStat) {
status = newStat;
return;
}
//Returns Students ID field
public Integer getID() {
return studentID;
}
//Returns Students location field
public String getLocation() {
return location;
}
//Returns Students status field
public String getStatus() {
return status;
}
//Returns all fields of the Student object in a comma separated string
@Override
public String toString() {
return ("ID: " + studentID + ", Location: " + location + ", Status: " + status);
}
}