Question: Write a Java program to store a sequence of high score entries for a video game in an array (max 4 entries) and the score

Write a Java program to store a sequence of high score entries for a video game in an array (max 4 entries) and the score must be higher than 500. You are required to implement the following classes:

a. GameEntry class, this class includes an integer representing the score itself, which you can identify as score. Another thing is include the name of the person earning this score, which you can identify as name. In addition, two accessor methods named getName and getScore.

b. Scoreboard class, this class includes the following methods:

i. add is an update method that add high score to the scoreboard. Note: Keep in mind that not every entry will necessarily qualify as a high score.

ii. printScoreboard is an accessor method that print all the elements in the scoreboard

c. Test class, this class includes the main program.

Write a Java program to store a sequence of high score entries

Sample output: the score is too low, the score must be higher than 500 Scoreboard is Empty the score is too low, the score must be higher than 500 Scoreboard is Empty New Score added Name: Cg Score: 780 New Score added Name: Cg Score: 700 Name: GG Score: 650 Ne Score added Name: Cg Score: 700 Name: MK Score: 670 Name: GG Score: 650

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!