Question: With the below being the base code, design, code in Java, test and document ( at least ) the following classes a Student _ Course

With the below being the base code, design, code in Java, test and document (at least) the following classes
a Student_Course class, a Student_Research class (both derived from the Student class)
Assuming in this program, you allow multiple student objects to be created (i.e. arraylist of student objects).
For course work students (Student_Course class):
(a) Contain enrolment type.
(b) Provide a reportGrade method such that it will output C(to identify as course work student), the Name (first name and last name), student number, the unit ID, the overall mark, and the final grade of the student.
For research students (Student_Research class):
(a) Contain enrolment type.
(b) Provide a reportGrade method such that it will output R(to identify as research student), the Name (first name and last name), student number, the overall mark, and the final grade of the student.
Student Class Code:
// Base class Student
public class Student {
// Private attributes
private String firstName;
private String lastName;
private long studentID;
// Constructor to initialize all fields
public Student(String firstName, String lastName, long studentID){
this.firstName = firstName;
this.lastName = lastName;
this.studentID = studentID;
}
// Getter for first name
public String getFirstName(){
return firstName;
}
// Setter for first name
public void setFirstName(String firstName){
this.firstName = firstName;
}
// Getter for last name
public String getLastName(){
return lastName;
}
// Setter for last name
public void setLastName(String lastName){
this.lastName = lastName;
}
// Getter for student ID
public long getStudentID(){
return studentID;
}
// Setter for student ID
public void setStudentID(long studentID){
this.studentID = studentID;
}
// Method to compare two students based on student ID
public boolean equals(Student otherStudent){
return this.studentID == otherStudent.studentID;
}
// Method to report grade (prints a message, meant to be overridden in child classes)
public void reportGrade(){
System.out.println("There is no grade here.");
}
// Method to display student information
public void displayStudentInfo(){
System.out.println("Student Name: "+ firstName +""+ lastName);
System.out.println("Student ID: "+ studentID);
}
}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!