Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/model/GraduateStudent.java
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,15 @@
public class GraduateStudent extends Student {
private String supervisor;
private String thesisTitle;

@Override
public void getStudentDetails() {
// TODO: Implement method 'getStudentDetails' for GraduateStudent.
throw new UnsupportedOperationException("Unimplemented method 'getStudentDetails'");
}

public GraduateStudent(String studentId,String firstName,String lastName,String major,String superString,String theString)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public GraduateStudent(String studentId,String firstName,String lastName,String major,String superString,String theString)
public GraduateStudent(String studentId,String firstName,String lastName,String major,String supervisor,String thesisTitle)

{
super(studentId, firstName, lastName, major);
this.supervisor=supervisor;
this.thesisTitle=thesisTitle;
}
}
21 changes: 4 additions & 17 deletions src/model/Loan.java
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Getters should return a value!
You should implement a constructor for Loan to initialize the variables. and then return them in the getter methods.
for example:

public Student getStudent() {
  return this.student;
}

Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,10 @@ public class Loan {
private Date loanDate;
private Date dueDate;

public void getBook() {
// TODO: Implement method 'getBook'.
throw new UnsupportedOperationException("Unimplemented method 'getBook'");
}

public void getStudent() {
// TODO: Implement method 'getStudent'.
throw new UnsupportedOperationException("Unimplemented method 'getStudent'");
}
public void getBook (Book book) {this.book=book;}
public void getStudent (Student student) {this.student=student;}
public void getLoanDate (Date loanDate) {this.loanDate=loanDate;}
public void getDueDate (Date dueDate) {this.dueDate=dueDate;}

public void getLoanDate() {
// TODO: Implement method 'getLoanDate'.
throw new UnsupportedOperationException("Unimplemented method 'getLoanDate'");
}

public void getDueDate() {
// TODO: Implement method 'getDueDate'.
throw new UnsupportedOperationException("Unimplemented method 'getDueDate'");
}
}
18 changes: 12 additions & 6 deletions src/model/Student.java
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
package model;

public abstract class Student {
private String studentId;
private String firstName;
private String lastName;
private String major;

public abstract void getStudentDetails();
protected String studentId;
protected String firstName;
protected String lastName;
protected String major;
public Student(String studentId,String firstName,String lastName,String major)
{
this.studentId=studentId;
this.firstName=firstName;
this.lastName=lastName;
this.major=major;
}
public abstract void getStudentDetails();
}
7 changes: 7 additions & 0 deletions src/model/UndergraduateStudent.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,11 @@ public void getStudentDetails() {
// TODO: Implement method 'getStudentDetails' for UndergraduateStudent.
throw new UnsupportedOperationException("Unimplemented method 'getStudentDetails'");
}

public UndergraduateStudent(String studentId,String firstName,String lastName,String major,int enrollmentYear)
{
super(studentId,firstName,lastName,major);
this.enrollmentYear=enrollmentYear;
}

}