Question: Template file to get started: https://umdrive.memphis.edu/kmalasri/public/ 1900/Lab7Template.zip Two-dimensional arrays are very useful for organizing large amounts of data. For example, suppose you have the following
Template file to get started: https://umdrive.memphis.edu/kmalasri/public/ 1900/Lab7Template.zip Two-dimensional 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: Player Game 0 Game 1 Game 2 Game 3 Game 4 Game 5 Game 6 Tim the Enchanter Dora the Explorer Catherine the Great 27 18 38 19 25 16 23 20 19 10 27 18 12 0 20 25 31 Suleiman the Magnificent | 17 8 -11- 21 15 09 Top the Inept (If computer scientists ruled the world, the NBA Finals would totally start from Game 0. Someday..) This information can be stored in a 2-D array, where each row of the array represents a player and each column represents a game. Index [U] of this array is the number of points scored by player i in game j (where bothi and j start counting from 0) - for example, index [0][5] would be the number of points scored by Tim the Enchanter in Game 5. Write the following methods (4 pts each) to process data stored in this format: I. public static double averagePPG(int[IIl 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(int[lI 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 This should return the average total points scored (by the entire team) per game, based on the data in the array scores. 4. public static int singleGameTopScoringPlayer(intlIl scores, int g) This should return the index of the highest-scoring player in game g, based on the data in the array 212 1 64513 d
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
