Question: Java/Chapter 7 Assignment : Write a program to process scores for a set of students. Arrays and methods must be used for this program. Process

Java/Chapter 7 Assignment: Write a 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.

The following is a sample run of the code. Make sure to fully test your program. Your processing must be VERY similar to the sample run. Here is a sample run:

Number of students: -1

Error try gain

Number of students: 0

Error try gain

Number of students: 4

[Assume the entered values are: bill, joe, mary, bob <<<< After user entered names from question]

[Assume the entered values are: 40, 55, 70, 58 <<<< After user entered score from question (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

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!