How do I get the average points from each player of both games?
Write a program that stores the name as a String and numbers as int's of 11 players on a team. Your program should display/output the average points scored of each player over the two games.
Nick (34), Joey (33), Ken (24), Ryan (11), Josh (3), Simon (6), Dillon (10), Mike (28), and Cameron (5).
Game 1: 4, 3, 3, 2, 4, 5, 6, 6, 7, 7, 8. Game 2: 8, 4, 3, 3, 5, 5, 7, 8, 8, 9, 5.
import java.util.Scanner;
import java.util.Arrays;
public class BasketballStats {
public static void main(String[] args) {
// TODO Auto-generated method stub
int[] jerseyNumber = {34, 33, 24, 11, 3, 13, 6, 4, 28, 10};
String[] playerName = {"Jim", "Joe", "Ken", "James", "John", "Bud",
"Clark", "Barry", "Jose", "Paul"};
int[] game1 = new int[11];
int[] game2 = new int[11];
for (int i = 0; i < 10; i++)
System.out.printf("Number %d: %s \n" , jerseyNumber[i],
playerName[i]);
}
public void setGame1Score() {
int[] jerseyNumber = {34, 33, 24, 11, 3, 13, 6, 4, 28, 10};
String[] playerName = {"Jim", "Joe", "Ken", "James", "John", "Bud", "Clark",
"Barry", "Jose", "Paul"};
Scanner input = new Scanner (System.in);
for (int i = 0; i < 10; i++) {
System.out.println("For game 1, how many points does he score?");
int game2 = input.nextInt();
}
}
}