Question
JAVA-intro to programming id player 1. George Washington 2. John Adams 3. Thomas Jefferson 4. James Madison 5. James Monroe 6. John Quincy Adams 7.
JAVA-intro to programming
id player
1. George Washington
2. John Adams
3. Thomas Jefferson
4. James Madison
5. James Monroe
6. John Quincy Adams
7. Andrew Jackson
8. Martin Van Buren
9. William H. Harrison
10. John Tyler
11. James K. Polk
12. Zachary Taylor
13. Millard Fillmore
14. Franklin Pierce
15. James Buchanan
16. Abraham Lincoln
17. Andrew Johnson
18. Ulysses S. Grant
19. Rutherford B. Hayes
20. James A. Garfield
21. Chester A. Arthur
22. Grover Cleveland
23. Benjamin Harrison
24. Grover Cleveland
25. William McKinley
id hits walks outs
1. 6 3 7
2. 2 7 5
3. 7 7 3
4. 5 0 6
5. 4 5 7
6. 0 1 5
7. 4 1 6
8. 6 0 7
9. 0 7 1
10. 4 7 4
11. 7 6 5
12. 2 1 3
13. 5 0 7
14. 0 1 0
15. 2 4 6
16. 2 2 2
17. 6 5 4
18. 4 2 0
19. 4 5 2
20. 2 3 0
21. 7 2 3
22. 4 3 7
23. 4 5 2
24. 1 3 3
25. 0 5 7
1. 6 4 1
2. 2 7 4
3. 6 1 1
4. 7 0 4
5. 5 6 6
6. 7 4 1
7. 2 7 2
8. 0 7 6
9. 5 3 4
10. 0 3 5
11. 3 1 5
12. 0 4 0
13. 3 0 7
14. 6 4 1
15. 2 1 0
16. 5 1 5
17. 7 7 0
18. 2 0 6
19. 7 1 6
20. 5 3 7
21. 1 1 0
22. 6 7 2
23. 6 6 0
24. 7 4 1
25. 2 4 0
1. 0 5 2
2. 3 0 2
3. 6 6 0
4. 5 4 0
5. 4 3 3
6. 2 0 0
7. 5 2 7
8. 2 4 3
9. 4 0 4
10. 3 7 0
11. 2 1 7
12. 3 1 5
13. 6 3 1
14. 1 1 6
15. 5 3 6
16. 7 0 5
17. 6 2 6
18. 0 6 3
19. 3 3 1
20. 5 7 7
21. 3 6 1
22. 0 4 0
23. 3 3 4
24. 1 5 7
25. 6 3 3
1. 2 3 2
2. 7 7 3
3. 6 2 3
4. 7 3 1
5. 3 5 0
6. 4 6 5
7. 4 0 1
8. 2 6 7
9. 1 6 5
10. 5 2 5
11. 7 1 5
12. 6 4 1
13. 2 3 4
14. 3 3 3
15. 4 6 0
16. 4 4 7
17. 5 6 4
18. 1 5 1
19. 7 6 4
20. 6 1 3
21. 7 7 3
22. 0 2 5
23. 3 5 7
24. 4 0 2
25. 4 1 3
ZOOM+ LAB 8 SUBJECT: Arrays, Sorting Given: A file which contains bb data in the form of OUTS ID HITS WALKS Where each line represents the results for a given player in a given game. There are 25 players with id's from 1- 25. Each player plays in many games so there should be multiplc lines for cach player. For the purpose lines of data. s of the lab you must have at least 100 A second file contains the player id and names (one line per player -25 lines) ID PlayerName Write a program to calculate each players Batting average, Sort the data in descending order by batting average and output a table of the results (Player name, id, total hits, total walks, total outs and batting average) Batting average = total hits / (total hit-total outs) Note that we are not interested in what a player did in a particular game. We are only interested in the totals for each player (in the example above player 1 has 5 hits, 1 walk and 2 outs) For a challenge 1) Use hits column to break ties in the average column (i.e. sort first by average then by hits) 2) Allow user to choose which column to sort byStep by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started