Question: java 2D arrays are very useful for organizing large amounts of data. For example, suppose you have the following data on the number of points

 java 2D arrays are very useful for organizing large amounts of

data. For example, suppose you have the following data on the number

java

2D arrays are very useful for organizing large amounts of data. For example, suppose you have the following data on the number of points scored by each player on a basketball team over each game of a seven-game series. (If computer scientists ruled the world, the NBA Finals would totally start from Game 0. Someday...) Game 0 Game 1 Game 2 Game 3 Game 4 Game 5 Game 6 Player 27 12 20 19 25 10 16 27 18 19 20 Tim the Enchanter Dora the Explorer 17 Catherine the Great Suleiman the Magnificent Top the Inep 38 17 25 11 21 15 This information can be stored in a 2D array, where each row of the array represents a player and each column represents a game. Index [i]? and j start counting from 0)-for example, index [OJ[5] would be the number of points scored by Tim the Enchanter in Game 5. Write the following methods (3 pts each) to process data stored in this format l of this array is the number of points scored by player i in game j (where both i 1. public static double averagePPG(intlIIl scores, int p) This should return the average points per game of player p, based on the data in the array scores 2. public static int singleGameScore(intIIl scores, int g) This should return the total points scored (by the entire team) in game g, based on the data in the array scores public static double averageGameScore(intIII scores) This should return the average total points scored (by the entire team) per game, based on the data in 3. the array scores 4. public static int singleGameTopScoringPlayer(intIl scores, int g) This should return the index of the highest-scoring player in game g, based on the data in the array scores 5. public statie void main(StringlI args) The main method should declare and instantiate a 2D array containing the above data, then call yo methods on it to verify they're working properly. Remember that you can use curly braces to quickly instantiate a 2D array with specific values

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!