Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question
100%
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
expand button
Transcribed Image 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
Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY