Question: In Java Main method Your main program will prompt the user for a test name and the number of scores the user will enter. After

In Java

Main method

Your main program will prompt the user for a test name and the number of scores the user will enter. After creating an arraylist to hold the scores, prompt the user for all the scores to hold in the arraylist. After all the scores are entered, then repeat back the score & letter grade.

GradeBook Object

Create an instance of a GradeBook object and pass the test name and arraylist to set the instance variables. At some point (inside a constructor or some other method), call a user-created method called setLetterGrades( ) that will set the letter grades that corresponds to the scores arraylist.

*There are multiple ways to set this up. You pick. Again, ultimate freedom. Get used to it.

Verify that the GradeBook object has getter and setter methods for all instance variables. Also, include a default no-argument constructor.

Use the chart below to figure out the appropriate letter grade.

Score (Greater than or equal to)

Letter Grade

90

A

80

B

70

C

60

D

Less than 60

F

Get the values back into the main program and print everything out.

Your output should look something like the example on page 2, with the user selecting different numbers for the scores array each time the program is ran or using a sentinel value loop.

Sample run

How many scores would you like to enter? 5

Enter a score: 46

Enter a score: 64

Enter a score: 72

Enter a score: 86

Enter a score: 94

Score -------- Grade

46 -------- F

64 -------- D

72 -------- C

86 -------- B

94 -------- A

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!