Question: Create two Java subclasses of your Person class called Student and Teacher. For the Student class, include the following attributes college and dorm. The Teacher
Create two Java subclasses of your Person class called Student and Teacher. For the Student class, include the following attributes college and dorm. The Teacher class needs the following attribute room # and one or more courses. For the add courses, our assignment requires that we use an ArrayList Group. You must have your constructors and methods for your classes including a method for printing the attributes.
Also, there shoud be a StudentTest and TeacherTest to test data for the classes.
This is the outline of what our teacher wants:
Person.java
| fname | getters/setters |
| lname | toString |
| age | |
| gender | |
| ssn |
Student.java
collegename getters/setters dormname toString
| roomNum | getters/setters |
| courseList | addCourse() ArrayList Group
|
| toString | |
|
|
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
