Question: Need help with bolded TODO methods in class CS2420Student in Java. NOTES: The CS2420Student class must adhere to the following rules: The equals method inherited

Need help with bolded TODO methods in class CS2420Student in Java. 

NOTES:

The CS2420Student class must adhere to the following rules:

The equals method inherited from UofUStudent may not be overridden.

The addScore method adds one score for the student, in the given category. If category is not exactly one of four strings: "assignment", "test", "lab", or "quiz", then the method has no effect.

The addScore method must make good use of a switch statement.

For the purposes of this assignment, all scores (including labs and quizzes) are out of 100.

The computeFinalScore method must use the weighting of score categories given: assignments 40%, tests 40%, labs 10%, Canvas quizzes 10%, with the modification that if a student has below a 65% test average, their test average is their final course score. If the student does not have at least one score in each of the categories (assignment, test, lab, quiz), this method returns 0.0.

The computeFinalGrade method must use the mapping of numeric scores to letter grades given. If the student does not have at least one score in each of the categories, this method returns "N/A".

Need help with bolded TODO methods in class CS2420Student in Java. NOTES:

Private helper methods may be added, as needed, but no public methods may be added, other than those listed above. (Note that this is a general rule for CS 2420 assignments students are always permitted to add private methods to classes, but are restricted from adding public or protected methods.)

CLASS UofUStudent  package assign02; /** * @version January 20, 2022 */ public class UofUStudent { private String firstName; private String lastName; private int uNID; /** * Creates a student from the given first name, last name, and uNID. * * @param firstName * @param lastName * @param uNID */ public UofUStudent(String firstName, String lastName, int uNID) { this.firstName = firstName; this.lastName = lastName; this.uNID = uNID; } /** * Getter method for the first name field of this student object. * * @return this student's first name */ public String getFirstName() { return this.firstName; } /** * Getter method for the last name field of this student object. * * @return this student's last name */ public String getLastName() { return this.lastName; } /** * Getter method for the uNID field of this student object. * * @return this student's uNID */ public int getUNID() { return this.uNID; } /** * Setter method for the name fields of this student object. * * NOTE: This method is provided since a student's name(s) may change. * No setter method is provided for the uNID, since it may not change. * * @param firstName - updated first name * @param lastName - updated last name */ public void updateName(String firstName, String lastName) { this.firstName = firstName; this.lastName = lastName; } /** * Two University of Utah students are considered equal if they have the same uNID. * * @param other - the object being compared with this student * @return true if the other object is a UofUStudent type and is equal to this student, * false otherwise */ public boolean equals(Object other) { // check to see if other is UofUStudent if(!(other instanceof UofUStudent)) return false; // if other is instanceof UofUStudent, cast to other UofUStudent u = (UofUStudent) other; // compare to see if all fields match if(this.firstName == u.firstName && this.lastName == u.lastName && this.uNID == u.uNID) { return true; } // if not all matched, return false return false; } /** * Returns a textual representation of this student. */ public String toString() { return this.firstName + " " + this.lastName + " (u" + String.format("%07d", this.uNID) + ")"; } }

CLASS CS2420 Student

package assign02; /** * TODO * @author */ public class CS2420Student extends UofUStudent { private EmailAddress contactInfo; public CS2420Student(String firstName, String lastName, int uNID, EmailAddress contactInfo) { super(firstName, lastName, uNID); this.contactInfo = contactInfo; } public EmailAddress getContactInfo() { return contactInfo; } /** * Adds one score for the student in the given category * assignment, test, lab, or quiz * Must use switch case * @param score * @param category */ public void addScore(double score, String category) { //TODO // must use a switch statement } } /** * Uses the weighting of score categories given in the CS 2420 syllabus, with the modification that * if a student has below a 65% test average, their test average is their final course score * @return */ public double computeFinalScore() { //TODO return 0; } /** * Uses the mapping of numeric scores to letter grades given in the CS 2420 syllabus * If the student does not have at least one score in each of the categories, * this method returns "N/A" * @return */ public String computeFinalGrade() { //TODO } } } 

\begin{tabular}{|ll|ll|ll|ll|ll|} \hline 93X100 & A & 87X

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!