|
|
@ -9,9 +9,9 @@ import java.util.List; |
|
|
|
*/ |
|
|
|
|
|
|
|
public class Student { |
|
|
|
String name; |
|
|
|
String id; |
|
|
|
String role; |
|
|
|
String studentName; |
|
|
|
String studentId; |
|
|
|
String studentRole; |
|
|
|
|
|
|
|
public Student(){ |
|
|
|
|
|
|
@ -25,33 +25,33 @@ public class Student { |
|
|
|
* @param role the role of the student in the system (should typically be "Student") |
|
|
|
*/ |
|
|
|
|
|
|
|
this.name = name; |
|
|
|
this.id = id; |
|
|
|
this.role = role; |
|
|
|
this.studentName = name; |
|
|
|
this.studentId = id; |
|
|
|
this.studentRole = role; |
|
|
|
} |
|
|
|
|
|
|
|
public String getName() { |
|
|
|
return name; |
|
|
|
public String getStudentName() { |
|
|
|
return studentName; |
|
|
|
} |
|
|
|
|
|
|
|
public String getId() { |
|
|
|
return id; |
|
|
|
public String getStudentId() { |
|
|
|
return studentId; |
|
|
|
} |
|
|
|
|
|
|
|
public String getRole() { |
|
|
|
return role; |
|
|
|
public String getStudentRole() { |
|
|
|
return studentRole; |
|
|
|
} |
|
|
|
|
|
|
|
public void setName(String name) { |
|
|
|
this.name = name; |
|
|
|
public void setStudentName(String studentName) { |
|
|
|
this.studentName = studentName; |
|
|
|
} |
|
|
|
|
|
|
|
public void setId(String id) { |
|
|
|
this.id = id; |
|
|
|
public void setStudentId(String studentId) { |
|
|
|
this.studentId = studentId; |
|
|
|
} |
|
|
|
|
|
|
|
public void setRole(String role) { |
|
|
|
this.role = role; |
|
|
|
public void setStudentRole(String studentRole) { |
|
|
|
this.studentRole = studentRole; |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
@ -61,15 +61,15 @@ public class Student { |
|
|
|
|
|
|
|
public void printStudentInfo() |
|
|
|
{ |
|
|
|
System.out.println("Name: " + getName()); |
|
|
|
System.out.println("ID: " + getId()); |
|
|
|
System.out.println("Role: " + getRole()); |
|
|
|
System.out.println("Name: " + getStudentName()); |
|
|
|
System.out.println("ID: " + getStudentId()); |
|
|
|
System.out.println("Role: " + getStudentRole()); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public void writeToFile(Student student, String filename) throws IOException { |
|
|
|
try(BufferedWriter writer = new BufferedWriter(new FileWriter(filename))){ |
|
|
|
String attributes = student.getName() + "\n" + student.getId() + "\n" + student.getRole(); |
|
|
|
String attributes = student.getStudentName() + "\n" + student.getStudentId() + "\n" + student.getStudentRole(); |
|
|
|
writer.write(attributes); |
|
|
|
} |
|
|
|
|
|
|
|