Question: Write a Java program to process scores for a set of students. Arrays and methods must be used for this program. Process: Read the number
Write a Java program to process scores for a set of students. Arrays and methods must be used for this program.
Process:
Read the number of students in a class. Make sure that the user enters 1 or more students.
Create an array with the number of students entered by the user.
Then, read the name and the test score for each student.
Calculate the best or highest score.
Then, Calculate letter grades based on the following criteria: o A when score is >= best score -10 o B when score is >= best score -20 o C when score is >= best score -30 o D when score is >= best score -40 o F Otherwise.
Calculate and display the average of test scores.
Use any sorting algorithm such as Bubble Sort or Selection Sort (DO NOT use predefined sort methods) to sort the data by name. Make sure the test scores are also sorted, accordingly.
Allow the user to enter a student name and display the corresponding test score. Issue an error message if the name is not in the list of students. Use a loop to allow the user to enter as many names as the user wishes to enter. Use the sentinel value done to exit the search process.
Minimal number of methods to define for this program:
1. A method to return a valid number of students
2. A method to return the name and test scores of the students
3. A method to return the best score
4. A method to display the letter grade along with the score information
5. A method to sort the data
6. A method to display the array of names and test scores
7. A method to search for a given name. This method should return the test score for the given name or -1 if the name is not found. You can use the returned value in the main method to display the score or to display an error message.
Here is a sample run:
Number of students: -1
Error try again
Number of students: 0
Error try again
Number of students: 4
Assume the entered values are: bill, joe, mary, bob
Assume the entered values are: 40 55 70 58 <<<< Note the best score is calculated to be 70
*** Grade Report ***
bill scored 40, grade is: C
joe scored 55, grade is: B
mary scored 70, grade is: A
bob scored 58, grade is: B
Average = 55.75
*** The sorted List ***
bill 40
bob 58
joe 55
mary 70
Enter a students name: joe
joe received a score of 55
Enter a students name: nancy
nancy is not a student
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
