Question: Computer Science Lab09A Lab Value - 100 Lab Goal : This lab was designed to teach you more about arrays of references. Lab Description :

 Computer Science Lab09A Lab Value - 100 Lab Goal : This
lab was designed to teach you more about arrays of references. Lab
Description : This lab will create an array of High school students
and print a class roster. Sample Input(labo9a.dat): Joseph, Jones, 398420, Pre Cal,
English, Chemistry, History, lunch, Compei, Band, Athletics Amanda, Pierce, 347208, Pre cal,
English, Physics, lunch, History, Comp5el, Choir, oft Jaime, Ortiz, 984390, History, Biology,

Computer Science Lab09A Lab Value - 100 Lab Goal : This lab was designed to teach you more about arrays of references. Lab Description : This lab will create an array of High school students and print a class roster. Sample Input(labo9a.dat): Joseph, Jones, 398420, Pre Cal, English, Chemistry, History, lunch, Compei, Band, Athletics Amanda, Pierce, 347208, Pre cal, English, Physics, lunch, History, Comp5el, Choir, oft Jaime, Ortiz, 984390, History, Biology, English, lunch, Compei, Sand, off, Athletics lladd 3 more lines to data file. Files needed: lab09a.dat Sample Output to start with: 1 Student.java 2. HSStudent.java Period: 6 Computer Science 3. MyClass.java 4. Tab09a.java 1. Jones, Joseph 398420 Pre Cal, English, Chemistry, History, lunch, CompSciy Band, Athletics 2. Pierce, Amanda 347208 Pre Cal, English, Physics, lunch, History CompSci, Choix oft 3. Ortiz, Jaime 984390 History, Biology, English, lunch, Band, CompSci, oft, Athletics 3. Students I Sample Output to finish with sorted names Period: 6 Computer Science 1. Jones, Joseph 398420 1. Pre Cal 2. English 3. Chemistry 4. History lunch 6. Compel 7. Band Athletion 2. Pierce, Amanda 347208 1. Pro Cal 2. English 3 Students Open with Sample Output to finish with sorted names Period: 6 Computer Science Jones, Joseph 398420 Pre Cal 2. English 3. Chemistry 4. History 5. Lunch CompSci 7. Band Athletics 2. Pierce, Amanda 347208 1. Pre Cal 2. English 3. Physics 4. lunch 5. History 6. Compses 7. Choir 8. oft Ortiz, Jaime 984390 1. History Biology 3. English 4. lunch Band 6. Compei 7. of 8. Athletics 3 Students public class Student { private String name; private int idNum; public Student () { name "Bob"; idNum = 9999; } public Student (String n, int id) { namen; idNum id; } 1 accessors and modifiers here public String toString() String output= ""; output += name + " " + idNum; return output; ) } public class HS Student extends Student implements comparablechs Student> private String classes: public HSStudent) super() classes = new String [8] public asstudent (string ni Int id, string (el) super in, id) class-cl 1 1 public int compare to (student this) 1 return 999) public String tostring String output output - super.toString()+" for (String Item : classes output + Item + "" return output 1 public class MyClass private student students private String clan Name: private int numStudents private int maxStudents private int class Period public MyClaas (String name, int num) W/ set the array to have the max number of elementa Vset classtame to 'name! //set numstudents to zero V/set maxstudents to max //set classPeriod to any number from 1-8 1 public void addrewStudent (HsStudent Aint 1 //add the new student at location 1 Wincrement the number of students 1 public void sorto) Arrays.sort (students) 17 you will need compareto in student for this to work public string tostring String output Weed to be finished turn output //solution import java.util. import java.io. public class labo9a 1 public statie void main(String[] args) throws IOException Scanner file - now Scanner(new File("lab09a.dat": MyClans new MyClass("Computer Science", 3) int numStudents while (file.hanNext > 1 string line - file.nextLine)) Scanner chopper - now Scanner (line chopper uneDelimiter",") while (chopper.has Next > string in chopper.next) string name chopper.next() String nane - Iname ", thane int ID - Integer.parseInt(chopper.next().trimon string Olsen - new string(1) for (int 1-0 t

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!