(Solved) : Objective Main Purpose Assignment Practice File Input Output 1 O Programming Assignment C Q41339629 . . .

Objective The main purpose of this assignment is to practice with file input and output (1/O). Programming Assignment CMU col

Sample Output Scores Average Name Burch 15 18 16 16.33 Watson Winorburg 13 14 23 20 16.80 14 [name] has the highest average s

Objective The main purpose of this assignment is to practice with file input and output (1/O). Programming Assignment CMU college basketball team has certain number of players, each of whom played games in the current season. The team information is stored in the file BaaketballData.txt. The file contains information of one player per line, with the following format: player’s last name followed by scores separated by spaces, followed by a sentinel value -1. The number of games that each player may play is between 0 and 5. For example, the file may contain Burch 15 18 16 -1 Watson -1 Winorburg 13 14 14 23 20 -1 It indicates that Burch played three games and scored 15, 18, and 16 points, respectively; Watson played no game; and Winorburg played all five games and scored 13, 14, 14, 23 and 20 points; and so on Write a Java program to read information from the file (BasketballData.txt) using a Scanner object, and write the output to another file (Basketbal1Team.txt) using a PrintWriter object. The output file should contain the original data (one line for each player, without -1) along with the player’s average score of the season, and announce who is the highest average-scoring player of the team. The average scores should be kept 2 decimal digits. In addition, each column should be aligned correctly using the printf method and appropriate format specifiers. Sample Output Scores Average Name Burch 15 18 16 16.33 Watson Winorburg 13 14 23 20 16.80 14 [name] has the highest average score [score] Show transcribed image text Objective The main purpose of this assignment is to practice with file input and output (1/O). Programming Assignment CMU college basketball team has certain number of players, each of whom played games in the current season. The team information is stored in the file BaaketballData.txt. The file contains information of one player per line, with the following format: player’s last name followed by scores separated by spaces, followed by a sentinel value -1. The number of games that each player may play is between 0 and 5. For example, the file may contain Burch 15 18 16 -1 Watson -1 Winorburg 13 14 14 23 20 -1 It indicates that Burch played three games and scored 15, 18, and 16 points, respectively; Watson played no game; and Winorburg played all five games and scored 13, 14, 14, 23 and 20 points; and so on Write a Java program to read information from the file (BasketballData.txt) using a Scanner object, and write the output to another file (Basketbal1Team.txt) using a PrintWriter object. The output file should contain the original data (one line for each player, without -1) along with the player’s average score of the season, and announce who is the highest average-scoring player of the team. The average scores should be kept 2 decimal digits. In addition, each column should be aligned correctly using the printf method and appropriate format specifiers.
Sample Output Scores Average Name Burch 15 18 16 16.33 Watson Winorburg 13 14 23 20 16.80 14 [name] has the highest average score [score]

Expert Answer


Answer to Objective The main purpose of this assignment is to practice with file input and output (1/O). Programming Assignment CM…