Code In Java NetBeans A University wishes to keep information on its students. The proposed Student class has the following instance variables: studentNo: String, studentName: String, dateOfBirth:...



Code In Java NetBeans


A University wishes to keep information on its students. The proposed Student class has the following instance variables: studentNo: String, studentName: String, dateOfBirth: Date, meritPoints: Integer. Merit Points represents the entry qualification achieved by a student, which is a number between 20 and 200. A class variable is also required, called noOfStudents, which will be incremented each time a Student instance is created. Write Java code to perform the following:


Q : The Student class is extended by two sub classes Undergraduate with an additional attribute testScore, and Postgraduate with an additional attribute GPA. Both the classes implement a calculateMerit() method that returns the overall merit of the student. The undergraduate merit is calculated by adding the test score to the merit points, while for the postgraduate GPA is added to the merit points. The sub classes’ constructor should invoke the super class’s constructor and the sub classes’ toString method should invoke the super class’s toString method.


A) At run time, add 10 to the total merit of the undergraduate student.



Jun 09, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here