MIS 4310-01 Programming Assignment 7 - 100 Points Due Friday ✓ Solved

Mis 4310 01 Programming Assignment 7 100 Pointsdue Friday Decemb

Mis 4310 01 Programming Assignment 7 100 Pointsdue Friday Decemb

Create a Java application that prints a list of the Spurs’ player names with FGM, FGA, FG%, determines the maximum FGM and FGA excluding LaMarcus Aldridge, finds the players with these maximum values, and outputs the findings.

Use the provided array of statistics and player names, and fill in the code to display the list of players with stats. Exclude LaMarcus Aldridge when calculating maximum FGM and FGA, but include him in the initial display. Specifically:

  • Print each player's name alongside their FGM, FGA, and FG% in a formatted list.
  • Find the highest FGM and FGA among players except LaMarcus Aldridge.
  • Identify which players achieved these maximums.
  • Display the maximum FGM, FGA and the corresponding player names, as well as the maximum FGA and the corresponding player names.

Sample Paper For Above instruction

Below is an example implementation of the Java application fulfilling the above instructions. The code uses the provided statistics and player names array, then processes and outputs the required information.

Sample Java Implementation

public class spurs_template {

public static void main(String[] args) {

// Array of player statistics: {FGM, FGA, FG%}

double[][] stats = {

{8.4, 16.8, 0.497},

{4.5, 9.6, 0.473},

{4.1, 8.4, 0.484},

{4, 9.8, 0.409},

{3.6, 6.9, 0.515},

{3.2, 8.7, 0.364},

{3, 7.3, 0.41},

{2.9, 7.1, 0.41},

{2.4, 5.3, 0.455},

{1.4, 2.7, 0.5},

{1.4, 3.8, 0.382},

{0.9, 2.2, 0.424},

{1, 1, 1},

{0.3, 1.7, 0.2},

{0, 0.5, 0}

};

// Player names in corresponding order

String[] playerNames = {

"LaMarcus Aldridge", "Rudy Gay", "Pau Gasol", "Danny Green", "Kyle Anderson",

"Patty Mills", "Manu Ginobili", "Dejounte Murray", "Bryn Forbes", "Brandon Paul",

"Joffrey Lauvergne", "Davis Bertans", "Matt Costello", "Darrun Hilliard", "Derrick White"

};

// Print header

System.out.println("Player Names with Stats:");

for (int i = 0; i

System.out.printf("%s: %.1f %.1f %.3f%n", playerNames[i], stats[i][0], stats[i][1], stats[i][2]);

}

// Initialize variables to track maximums excluding LaMarcus Aldridge (index 0)

double maxFGM = -1;

int maxFGMIndex = -1;

double maxFGA = -1;

int maxFGAIndex = -1;

// Loop through stats to find maximum FGM and FGA excluding LaMarcus Aldridge

for (int i = 1; i

if (stats[i][0] > maxFGM) {

maxFGM = stats[i][0];

maxFGMIndex = i;

}

if (stats[i][1] > maxFGA) {

maxFGA = stats[i][1];

maxFGAIndex = i;

}

}

// Output the results

System.out.println("------------------");

System.out.printf("Maximum FGM (excluding LaMarcus Aldridge): %.1f by %s%n", maxFGM, playerNames[maxFGMIndex]);

System.out.printf("Maximum FGA (excluding LaMarcus Aldridge): %.1f by %s%n", maxFGA, playerNames[maxFGAIndex]);

}

}

This program prints all player stats, identifies the highest number of FGM and FGA among players excluding LaMarcus Aldridge, then displays those maximums and associated players.

References

  • Oracle Java Documentation: https://docs.oracle.com/javase/tutorial/
  • Effective Java, 3rd Edition by Joshua Bloch
  • Head First Java by Kathy Sierra and Bert Bates
  • Java Programming, Comprehensive Guide by Herbert Schildt
  • Stack Overflow: https://stackoverflow.com/
  • Geeks for Geeks Java Tutorials: https://www.geeksforgeeks.org/java/
  • Java 8 in Action by Raoul-Gabriel Urma et al.
  • W3Schools Java Tutorial: https://www.w3schools.com/java/
  • Programming by Doing - Purdue University
  • Class notes and assignments from MIS 4310 course materials