Question: Please use java only and provide the code accurately Given bellow the information of a teacher or a student in every line. s,John Adams,23,3.67,AG6731H t,Eugenia
Please use java only and provide the code accurately
Given bellow the information of a teacher or a student in every line.
s,John Adams,23,3.67,AG6731H t,Eugenia Rho,30,43900 s,Elsie Caldwell,43,2.65,A472398FAD s,Johnnie Watts,64,3.62,AS796823 t,Myra Stanley,78,74982 t,Janice Bailey,73,28974 t,Andy Nash,27,74893 s,Dominic Nunez,21,2.46,312HQKJG s,Freddie Drake,21,3.62,JKLA64783 t,Willis Bass,39,89214 s,Mable Waters,36,3.87,HJFASOIY32 s,Alberta Morton,25,3.91,HJAKS79382
The format for a teacher is: t,,D 1. From your Main Class, read every line of the file 2. If the line contains the information of a teacher, create a Teacher object with this information. Store the object in an ArrayList that can hold Teacher objects. 3. If the line contains the information of a student, create a Student object and store the object in an ArrayList that can hold Student objects 4. Sort the ArrayList containing Teacher objects according to salary. Print out this sorted ArrayList. 5. Sort the ArrayList containing Student objects according to their names. Print out this sorted ArrayList
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
