Question: For this assignment you are to create a basic class hierarchy to represent students at a university. The superclass: At the top of the hierarchy

 For this assignment you are to create a basic class hierarchyto represent students at a university. The superclass: At the top ofthe hierarchy should be a class called Student. The Student class shouldbe an abstract class and capable of representing the following data itemsfor each student: name (a String value) address (a String value) age

For this assignment you are to create a basic class hierarchy to represent students at a university. The superclass: At the top of the hierarchy should be a class called Student. The Student class should be an abstract class and capable of representing the following data items for each student: name (a String value) address (a String value) age (an integer value) student ID (A four digit integer value that uniquely identifies each student-make use of a static variable to guarantee the uniqueness of student IDs, similar to the approach used in previous assignments.) . The Student class should include the following methods: "getters" and "setters" - methods should be provided to set and retrieve each of its data items. They should be named appropriately, for example: getnName) and setName() for the name field 1ean is PassingGrade (double grade)-this should be an abstract method that accepts an argument of type double and returns a boolean value. The purpose of this method is to check to see if the argument it receives (grade) is a passing grade. If it is a passing grade, the isPassingGrade method should return "true", otherwise it should return "false". Since different categories of students have different definitions of a passing grade, the implementation of this method is appropriately left to subclasses. toString ) a toString method should be provided that will return a reasonable String representation including the values of the name, ID, age, and address fields The Student class should also provide a constructor that accepts parameters to be used in setting initial values for its fields when creating a new object (for the name, address, and age fields). The constructor should also initialize the student ID field to a unique value as described above. The first student ID should be 1000, the second should be 1001, the third should be 1002, etc. The subclasses: Two subclasses of the Student class should be created, one named "Graduate" to represent graduate students, the other named "Undergrad" to represent undergraduate students The "Graduate" class should inherit the data members of the Student class as described above (name address, age, and student ID). In addition, the Graduate class should add an additional integer field called greScore to represent the student's score on the GRE exam. A concrete implementation of the isPassingGrade () method should also be provided. For graduate students, the isPassingGrade () method should consider a grade of 70 or above to be passing. That is, if the argument it receives is 70 or higher, the method should return a value of "true". Otherwise it should return "false" The "Undergrad" class should also inherit the data members of the Student class as described above (name, address, age, and student ID). In addition, the Undergrad class should add an additional integer field called satScore to represent the student's score on the SAT exam. A concrete implementation of the isPassingGrade () method should also be provided. For undergraduate students, the isPassingGrade () method should consider a grade of 60 or above to be passing. That is, if the argument it receives is 60 or higher, the method should return a value of "true". Otherwise it should return "false" Both the Graduate and Undergrad classes should provide created. The Graduate constructor should initialize its greScore field, and then call on the superclass constructor to initialize its inherited fields (name, address, age, and student ID). Similarly, the Undergrad class should initialize its satScore field, and then call on the superclass constructor to initialize its inherited fields (name, address, age, and student ID), constructor rs to initialize fields as objects are Testing your classes You should create a class named StudentTest that will test the functionality of your class hierarchy. In the main() method of the StudentTest class, include program statements to create at least two Graduate objects and two Undergrad objects. Make sure to provide appropriate values to the constructors when the new objects are created. Ensure that the fields for Graduate and Undergrad objects are established correctly, and that they are assigned unique student IDs, by printing their string representations. Sample output is shown below some graduate students are: name James ID :1000 age :27 address :1100 N Corral GRE Score: 140 name Ross ID 1001 age :31 address:628 W Ave L GRE Score: 148 some undergraduate students are: name Nick ID :1002 age :17 address :714 University Blvd SAT Score: 1220 name William ID :1003 age :19 address :323 Broadway SAT Score: 1200 Also make sure in your StudentTest class to check the concrete implementation of the isPassingGrade () method for both the Graduate and Undergrad classes by sending each values to evaluate and making sure the results are as expected. For example, the following code segments should each produce output showing the student passed the exercise: if(gradStudent1.isPassingGrade (81)) System.out.printin(gradStudent1.getName)passed exercise 1"); System.out.println(gradStudent1.getName()should resubmit exercise 1"); else if (undergradstudent2. sPassingGrade( 75) ) System.out.println(undergradStudent2.getNamepassed exercise 1"); else System.out.println (undergradStudent2.getName(" should resubmit exercise 1"); As always, make sure to include comments in your code to document your program. In particular make sure to include your name, K-number, and the program creation date in a heading comment at the top of the program. For this assignment you are to create a basic class hierarchy to represent students at a university. The superclass: At the top of the hierarchy should be a class called Student. The Student class should be an abstract class and capable of representing the following data items for each student: name (a String value) address (a String value) age (an integer value) student ID (A four digit integer value that uniquely identifies each student-make use of a static variable to guarantee the uniqueness of student IDs, similar to the approach used in previous assignments.) . The Student class should include the following methods: "getters" and "setters" - methods should be provided to set and retrieve each of its data items. They should be named appropriately, for example: getnName) and setName() for the name field 1ean is PassingGrade (double grade)-this should be an abstract method that accepts an argument of type double and returns a boolean value. The purpose of this method is to check to see if the argument it receives (grade) is a passing grade. If it is a passing grade, the isPassingGrade method should return "true", otherwise it should return "false". Since different categories of students have different definitions of a passing grade, the implementation of this method is appropriately left to subclasses. toString ) a toString method should be provided that will return a reasonable String representation including the values of the name, ID, age, and address fields The Student class should also provide a constructor that accepts parameters to be used in setting initial values for its fields when creating a new object (for the name, address, and age fields). The constructor should also initialize the student ID field to a unique value as described above. The first student ID should be 1000, the second should be 1001, the third should be 1002, etc. The subclasses: Two subclasses of the Student class should be created, one named "Graduate" to represent graduate students, the other named "Undergrad" to represent undergraduate students The "Graduate" class should inherit the data members of the Student class as described above (name address, age, and student ID). In addition, the Graduate class should add an additional integer field called greScore to represent the student's score on the GRE exam. A concrete implementation of the isPassingGrade () method should also be provided. For graduate students, the isPassingGrade () method should consider a grade of 70 or above to be passing. That is, if the argument it receives is 70 or higher, the method should return a value of "true". Otherwise it should return "false" The "Undergrad" class should also inherit the data members of the Student class as described above (name, address, age, and student ID). In addition, the Undergrad class should add an additional integer field called satScore to represent the student's score on the SAT exam. A concrete implementation of the isPassingGrade () method should also be provided. For undergraduate students, the isPassingGrade () method should consider a grade of 60 or above to be passing. That is, if the argument it receives is 60 or higher, the method should return a value of "true". Otherwise it should return "false" Both the Graduate and Undergrad classes should provide created. The Graduate constructor should initialize its greScore field, and then call on the superclass constructor to initialize its inherited fields (name, address, age, and student ID). Similarly, the Undergrad class should initialize its satScore field, and then call on the superclass constructor to initialize its inherited fields (name, address, age, and student ID), constructor rs to initialize fields as objects are Testing your classes You should create a class named StudentTest that will test the functionality of your class hierarchy. In the main() method of the StudentTest class, include program statements to create at least two Graduate objects and two Undergrad objects. Make sure to provide appropriate values to the constructors when the new objects are created. Ensure that the fields for Graduate and Undergrad objects are established correctly, and that they are assigned unique student IDs, by printing their string representations. Sample output is shown below some graduate students are: name James ID :1000 age :27 address :1100 N Corral GRE Score: 140 name Ross ID 1001 age :31 address:628 W Ave L GRE Score: 148 some undergraduate students are: name Nick ID :1002 age :17 address :714 University Blvd SAT Score: 1220 name William ID :1003 age :19 address :323 Broadway SAT Score: 1200 Also make sure in your StudentTest class to check the concrete implementation of the isPassingGrade () method for both the Graduate and Undergrad classes by sending each values to evaluate and making sure the results are as expected. For example, the following code segments should each produce output showing the student passed the exercise: if(gradStudent1.isPassingGrade (81)) System.out.printin(gradStudent1.getName)passed exercise 1"); System.out.println(gradStudent1.getName()should resubmit exercise 1"); else if (undergradstudent2. sPassingGrade( 75) ) System.out.println(undergradStudent2.getNamepassed exercise 1"); else System.out.println (undergradStudent2.getName(" should resubmit exercise 1"); As always, make sure to include comments in your code to document your program. In particular make sure to include your name, K-number, and the program creation date in a heading comment at the top of the program

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!