Question: Hello, please help create constructors, getters, setters, for MasterStudent and Undergraduate classes, using the given code from the Student and TestStudents classes. Then if possible

Hello, please help create constructors, getters, setters, for MasterStudent and Undergraduate classes, using the given code from the Student and TestStudents classes. Then if possible update the Student and TestStudents classes. If confused, all instructions for the assignment are commented within the code. Please take your time and read all instructions in the code, if you can only complete part of it thats fine. Program is in Java language! Thanks!

Student Class:

Hello, please help create constructors, getters, setters, for MasterStudent and Undergraduate classes,

using the given code from the Student and TestStudents classes. Then if

TestStudents Class:

possible update the Student and TestStudents classes. If confused, all instructions for

Undergraduate class:

the assignment are commented within the code. Please take your time and

MasterStudent class:

read all instructions in the code, if you can only complete part

package assign1_template; 1/2.3.1 mark the class to implement the generic interface Comparable and compare two students. public class Student { 1/2.3.1 add your implementation of the compareTo(...) method // compare this student to the other student passed based on their names. // first by last name, then first name if the last name is the same. // return o, positive integer, or negative integer values 11 0 if this student's name is the same as the other student's name, positive integer if this student's name follows the other student's name in the alphabetical order, negative integer if this student's name precedes the other student's name in the alphabetical order. I/Don't change the code below. Just use them. private String id; private String firstName; private String lastName; private String major; private String degree; private double gpa; //constructors public Student() { public Student(String id, String firstName, String lastName, String major, String degree, double gpa) { this.id = id; this.firstName = firstName; this. lastName = lastName; this.major = major; this.degree = degree; this.gpa = gpa; } 1/setters public void setDegree(String degree) { this.degree = degree; } public void set Id (String id) { this.id = id; } public void setFirstName(String firstName) { this.firstName = firstName; } public void setLastName(String lastName) { this.lastName = lastName; } public void setMajor(String major) { this.major = major; } public void setGpa(double gpa) { this.gpa = gpa; } //getters public String getDegree() { return degree; } public String getId() { return id; 2 tnis.lastName = lastName; this.major = major; this.degree = degree; this.gpa = gpa; } // setters public void setDegree(String degree) { this. degree = degree; } public void setId(String id) { this.id = id; } public void setFirstName(String firstName) { this. firstName = firstName; } public void setLastName(String lastName) { this. lastName = lastName; } public void setMajor(String major) { this.major = major; } public void setGpa (double gpa) { this.gpa = gpa; } //getters public String getDegree() { return degree; } public String getId() { return id; } public String getFirstName() { return firstName; } public String getLastName() { return lastName; } public String getMajor() { return major; } public double getGpa() { return gpa; } @Override public String toString() { return "id: " + id + ", firstName: " + firstName + ", lastName: " + lastName + ", major: " + major + ", degree: " + degree + ", gpa: " + gpa; } + //optional: for testing the coding of your student class. Il verify the code implementing Comparable interface in Java API public static void main(String[] args) { } package assign1_template; public class TestStudents { public static void main(String[] args) { 1/2.2 Code given to you. Just use them. //create an array of Student objects. Student[] cisDept = new Student [4]; 1/Create and add 4 students, two undergraduates, two master students // add these students to the array //They are commented since you haven't added your code to Undergraduate, MasterStudent /* String[] theisCommittee = {"Tom", "Richard", "Jamie"}; cisDept [0] = new MasterStudent("222", "Steve", "Jobs", "IST", "MS", 3.5, "How to make ipad smarter", "Jamie", theisCommittee); cisDept [1] = new Undergraduate("444", "Bill", "Gates", "CS", "BS", 3.0, "Erin", "Sally"); String[] theisCommittee2 = {"Jie", "Zoran", "Gene"}; cisDept [2] = new MasterStudent ("333", "Amy", "Jobs", "CS", "MS", 3.8, "Study of Robots That can Perform", "Eduard", theisCommittee2); cisDept [3] = new Undergraduate("111", "Melinda", "Gates", "IST", "BS", 3.0, "Erin", "Frank"); */ 1/2.2 Add the code to do the task below. 1/Use a loop to print the information about all students in the student array. // Must use the toString() methods 1/2.3.2 add the code for the task below // call indexOfMin(...), passing the array cisDept, // print the student located at the return value of indexOfMin(...) } 1/2.3.2 add the code for the task below // implement this method, return the index of the first student in the array in the alphabetical order of student names (last name first, then first name) // You must call compareTo(...) method in your Student class. // Using Arrays.sort(...) in this method will lead to point deduction. public static int indexOfMin(Student[] myDept) { //you MUST call compareTo(...) method in your student class li Using Arrays. sort(...) in this method will lead to point deductions. return -1; } } package assign1_template; public class Undergraduate extends Student { 7/2.1.2 Add the code for tasks below //add new data fields: generalEduAdvisor, majorAdvisor private String generalEduAdvisor; private String majorAdvisor; //add two required constructors //add getters for all new data fields //add setters for all new data fields //add new toString() method that overrides the toString() in Student class //optional: for testing the coding of your Undergraduate class. public static void main(String[] args) { } } package assign1l_template; public class Masterstudent extends Student { 1/2.1.3 Add the code for the tasks below. I/add new data fields: thesis, thesisAdvisor, theis Committee private String thesis; private String thesisAdvisor; private String[] committee; //thesis committee, excluding thesis advisor //add two required constructors //add getters for all new data fields //add setters for all new data fields //add new toString() method that overrides the toString() in Student class //optional: for testing the coding of your Masterstudent class. public static void main(String[] args) { } }

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 Databases Questions!