6. Design a Java class with a main method that does the following. You must include a meaningful comment for main and each method a. Main invokes a method readScores to read input from a file (name of...


6. Design a Java class with a main method that does the following. You must include a meaningful<br>comment for main and each method<br>a. Main invokes a method readScores to read input from a file (name of your choice) that<br>contains the name of the bowlers (no more than 25) and their bowling scores (two scores<br>per bowler). The program stops reading values when it has reached the end of the file.<br>For example, the file might contain:<br>Bob 203 176<br>Jane 210 253<br>Jack 300 189<br>Eileen 220 298<br>• As the method reads the data, it stores the name into a String array and the average<br>of the two bowling scores into an array of double.<br>• The method returns the actual number of bowlers read in<br>b. Main then invokes a method computeOverallAvg to:<br>compute (a) the overall average score of all the bowlers combined, (b) the average<br>score and name of the bowler with the highest average score and (c) the average<br>score and name of the bowler with the lowest average scores.<br>print to the console (a) the overall average score, (b) the name and average score of<br>the bowler with the highest average score and (c) the name and average score of the<br>bowler with the lowest average score. Average scores should appear with two<br>decimal places.<br>• The method receives an array of double, an array of String and the number of<br>records read in by readScores<br>c. Main invokes a method doParallelSort where the primary sort is the average score in<br>descending order (highest to lowest) and the bowlers' names are synched with the averages<br>The method receives an array of String, an array of double and the number of<br>records read in by readScores<br>d. Main then prints to a file (name of your choice) the values of the sorted arrays - primary order<br>is average score (with two decimal places) in descending order with bowler name next to it. A<br>heading should appear above the scores and names which is aligned with the data. For<br>example,<br>Score<br>Bowler<br>259.00<br>Eileen<br>244.50<br>Jack<br>231.50<br>Jane<br>189.50<br>Bob<br>

Extracted text: 6. Design a Java class with a main method that does the following. You must include a meaningful comment for main and each method a. Main invokes a method readScores to read input from a file (name of your choice) that contains the name of the bowlers (no more than 25) and their bowling scores (two scores per bowler). The program stops reading values when it has reached the end of the file. For example, the file might contain: Bob 203 176 Jane 210 253 Jack 300 189 Eileen 220 298 • As the method reads the data, it stores the name into a String array and the average of the two bowling scores into an array of double. • The method returns the actual number of bowlers read in b. Main then invokes a method computeOverallAvg to: compute (a) the overall average score of all the bowlers combined, (b) the average score and name of the bowler with the highest average score and (c) the average score and name of the bowler with the lowest average scores. print to the console (a) the overall average score, (b) the name and average score of the bowler with the highest average score and (c) the name and average score of the bowler with the lowest average score. Average scores should appear with two decimal places. • The method receives an array of double, an array of String and the number of records read in by readScores c. Main invokes a method doParallelSort where the primary sort is the average score in descending order (highest to lowest) and the bowlers' names are synched with the averages The method receives an array of String, an array of double and the number of records read in by readScores d. Main then prints to a file (name of your choice) the values of the sorted arrays - primary order is average score (with two decimal places) in descending order with bowler name next to it. A heading should appear above the scores and names which is aligned with the data. For example, Score Bowler 259.00 Eileen 244.50 Jack 231.50 Jane 189.50 Bob
Jun 05, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here