Question
Use Java as the coding language For this assignment you are to download the following file: People.txt Download People.txtand create the FULL classes that will
Use Java as the coding language
For this assignment you are to download the following file: People.txt Download People.txtand create the FULL classes that will store your data.
Note:
Students have: firstName, lastName, age, gender, and yearInSchool
Professors have: firstName, lastName, age, gender, yearsTeaching, and salary
Create a generic class that stores the common fields and classes that will inherit from that class (i.e., Student and Professor).
For the previous 3 classes make sure you are doing basic data checking (e.g., age can not be less than 0)
Also, a FULL class means to include:
- Private properties
- Constructors:
- String
- String[]
- Copy
- Workhorse
- Methods (min)
- clone (can't have a clone in your abstract class)
- equals
- toString()
- Getters and Setters
Create a Tester class that will open the file and import the data.
In Tester Create the following reports:
- Print all seniors
- Print all professors that make more than the average salary of all professors
- All impossible professors. A professor must be at least 21 years old to be teaching. Therefore, if the difference between their age and the number of years teaching is less than 21 then their data is incorrect.
First few lines of People.txt
Student Kristien Mapholm 20 Female 3 Student Ellie Cheves 22 Female 3 Student Ezri Bruyns 22 Male 4 Student Crosby Wrate 19 Male 1 Student Dyna Loraine 19 Female 1 Student Goran Marquis 18 Male 1 Student Germain Hollingsbee 22 Female 4 Student Joell Borchardt 17 Female 2 Student Gawain Pelfer 22 Male 1 Student Decca Kropp 20 Male 1 Professor Spenser Harridge 62 Male 30 153342 Professor Ban Janicijevic 46 Male 34 158482 Professor Alwin Auguste 35 Male 22 64403 Professor Richard Di Giacomettino 85 Male 21 123363
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started