Question: IN JAVA: write a class that uses the StudentType class (you will find StudentType.java a good starting place). The new class is a rosterType needed

IN JAVA:

write a class that uses the StudentType class (you will find StudentType.java a good starting place). The new class is a "rosterType" needed to implement a Student Gradebook to be used to grade a course. Your portion of the program will need to maintain information for a maximum class size of 20 students. The interface specification is:

 class rosterType { /** Constructor to initialize the class roster to an empty state ready to receive new students to a maximum of 20 students. */ public rosterType () /** Tells whether or not the class is empty or full */ public boolean isFull () public boolean isEmpty () /** Add a new student to the class in SID sorted order. If the class is full do nothing, discard the student. */ public void addStudent (StudentType newStudent) /** Return the student specified by the student id. If no student matches the id, return an empty student. */ public StudentType findStudent (String sid) /** toString method returns the entire class as a string with tabs between fields of a student and newlines between students. */ public String toString () /** printByGrade prints out the entire class sorted by the total grade each student has earned. Additionally, the method will output the mean score (the average score) and the median score (the middle value or the average of the two middle values in an even number of scores). boobie tofuhead 878-51-7051 96 stinky rhinohonker 175-12-7353 91 buttercup tofushorts 620-27-4302 89 Mean: 92 Median: 91 The use of this method should not alter the original sorting of the roster. If the class is empty, it will print the message: The class is empty */ public void printByGrade () } 

_____________________________________________________________________________________________

StudentType.java :

/** */ public class StudentType { private String Fname; private String Lname; private String SID; private double [] Scores; private char Letter; private static int MaxScores = 10; // initialize all String attributes to an empty String, // initialize all numeric values to zero. public StudentType () { Fname = ""; Lname = ""; SID = ""; Scores = new double [MaxScores]; for (int i = 0; i < MaxScores; ++i) Scores [i] = 0; } public StudentType (String lname, String fname, String sid) { Fname = fname; Lname = lname; SID = sid; Scores = new double [MaxScores]; for (int i = 0; i < MaxScores; ++i) Scores [i] = 0; } // set and get Last Name public void setLname(String lname) { Lname = lname; } public String getLname() { return (Lname); } // set and get First Name public void setFname(String fname) { Fname = fname; } public String getFname() { return (Fname); } // set and get SID public void setSID(String sid) { SID = sid; } public String getSID() { return (SID); } // get a formatted SID public String getFormatedSID() { StringBuffer tSID = new StringBuffer (SID); if (SID.length () != 0) { tSID.insert (5, '-'); tSID.insert (3, '-'); } return tSID.toString (); } // set and get Score public void setScore(int quizNum, double score) { if (quizNum > 0 && quizNum <= MaxScores) Scores [quizNum - 1] = score; } public double getScore(int quizNum) { double rScore = 0.0; if (quizNum > 0 && quizNum <= MaxScores) rScore = Scores [quizNum - 1]; return rScore; } public double getTotal() { double sum = 0; for (int i = 0; i < MaxScores; ++i) sum += Scores [i]; return sum; } // set and get letter grade for the current quiz public void setLetter (char letterGrade) { Letter = letterGrade; } public char getLetter () { return Letter; } // get First Name Last Name formatted ID as a String // there will be a space between the first name and the // last name and a tab between the last name and the ID public String toString() { return Fname + " " + Lname + "\t" + getFormatedSID (); } } 

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!