Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Create a program (but don\'t use the method printMax) that reads game scores, an

ID: 3679363 • Letter: C

Question

Create a program (but don't use the method printMax) that reads game scores, and then assigns these scores into the leaderboard (if they make it into the leaderboard): "First place" if score is best, then "Second," "Third," and so on. The program prompts the user to enter the total number of gamers, then prompts the user to enter all of the scores, and concludes by displaying the grades. Here is a sample run:

Enter the number of scores you'd like to enter: 4

Then enter four scores: 40 55 70 58

Gamer 0 score is 40 and grade is "Fourth."

Gamer 1 score is 55 and grade is "Third."

Gamer 2 score is 70 and grade is "First."

Gamer 3 score is 58 and grade is "Second".

Write the line that declares a two-dimensional array of strings named chessboard. That is, how would I declare a two-dimension array of strings that is called chessboard? You would declare a String array by saying " String []" correct? Now that's just a single array. How can I make that a two-dimension array? And how would I name it chessboard?

Write the line that declare and creates a two-dimensional array of chars, tictactoe, with 3 rows, each with 3 elements , and initialize it to all space characters.

Write the line that declares and instantiates a 8x8 two-dimensional array of strings named chessboard.

A 2-dimensional 3x3 array of ints , has been created and assigned to tictactoe. Write an expression whose value is that of the first element in the last row.

Explanation / Answer

java program:


import java.io.*;
import java.util.Scanner;
public class Gamer {
public static void main(String []args)throws IOException{
int noOfGamers;
Scanner scan=new Scanner(System.in);
System.out.println("Enter no of Gamers(max 10)");
noOfGamers=scan.nextInt();
int []Score=new int[noOfGamers];
int []Rank=new int[noOfGamers];
int count=0;
System.out.println("Then enter "+noOfGamers+" scores:");
for(int i=0;i<Score.length;i++)
{
Score[i]=scan.nextInt();
}
  
for(int i=0;i<Score.length;i++)
{
count=1;
  
for(int j=0;j<Score.length;j++)
{
if(Score[i]<Score[j])
count++;
}
Rank[i]=count;
}
for(int i=0;i<Score.length;i++)
{
switch(Rank[i])
{
case 1:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "First." ");break;
case 2:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "Second." ");break;
case 3:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "Third." ");break;
case 4:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "Fourth." ");break;
case 5:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "Fifth." ");break;
case 6:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "Sixth." ");break;
case 7:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "Seventh." ");break;
case 8:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "Eighth." ");break;
case 9:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "Nineth." ");break;
case 10:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "Tenth." ");break;
default:System.out.println("Gamer "+i+" score is "+Score[i]+ " and grade is "more than Tenth." ");
  
  
}
}
  
}
}

output:

run:
Enter no of Gamers(max 10)
5
Then enter 5 scores:
89
56
23
12
45
Gamer 0 score is 89 and grade is "First."
Gamer 1 score is 56 and grade is "Second."
Gamer 2 score is 23 and grade is "Fourth."
Gamer 3 score is 12 and grade is "Fifth."
Gamer 4 score is 45 and grade is "Third."
BUILD SUCCESSFUL (total time: 8 seconds)

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote