Question: Write a program to create a Student class with variables id , and name. Include methods getStudent ( ) and showStudent ( ) in the

Write a program to create a Student class with variables id, and name. Include methods getStudent() and showStudent() in the class. Create another class named Graduate, which is a child of the Student class. Include a member variable degree, and methods getGraduate() and showGraduate() in the class.
Finally, create a third class named PhD, which is a child of the Graduate class. Include a variable thesisTitle, and methods getPhD() and showPhD() in the class.
The Java program should consist of:
1) Set and get methods for all attributes in the class
2) A constructor for the class
3) Methods as mentioned above
4) Passing of appropriate parameters/arguments in methods/functions where necessary
5) Create a Main class with the static void main(String[] args) that will run the program as follows:
a) Read the line(s) from the file StudentData.txt
i. Split each line where there exists a comma (,) and store it in an array
ii. Breakdown the data into sub parts
b) Create another array named as PhDRequirement that contains the elements
"BSc,BA, MSc, MA, MPhil
c) Traverse through the PhDRequirement array
i. Check if the element in PhDRequirement array equals the data (Student
Degree) in the array created in (a) above, and if yes
I should create an object of the PhD class, read and display their
details in Java Console as per the format given in the screenshot. (Hint: Only if condition, NO else part). Note that, only those data from the text files that has BSc, BA, MSc, Sample data of the "StudentData.txt" file
Expected OutputMA, MPhil as Degree requirement are displayed while others are
ignored.
 Write a program to create a Student class with variables id,

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!