Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Suppose you are commissioned by the Australian Football Association (AFL) to write a program designed to produce statistics based on complete scores recorded in a

Suppose you are commissioned by the Australian Football Association (AFL) to write a program designed to produce statistics based on complete scores recorded in a season. These scores are kept in a file called afl.txt (available on interact resources). You are also given the following information about a football season:

League consists of 18 football teams

There are 22 rounds in each season

In each round teams play against each other and the score of each team is recorded as an integer and kept in the text file referred to above (aft.txt)

Your task is to write a complete java program (a java class with the main method) called ProcessScores, which will read the scores from the text file provided, store the scores in an array of integers and then using a number of independent static methods, calculate and display the required statistics relating the afl scores.

The java class you are required to author will contain the following static methods:

lowest will take the array of scores as an argument and return the lowest score in the season

highest will take the array of scores as an argument and return the highest score in the season

range will take the array of scores as an argument and return the difference between the highest score and the lowest score in the season

average will take the array of scores as an argument and return the average of all scores in the season

median will take the array of scores as an argument and return the median score in the season

mode will take the array of scores as an argument and return the mode of the scores in the season

Note that all of the methods described above, should be static methods; user defined methods (you have the write the definition of each yourself); and completely independent of each other (you should not invoke anyone of them within the other method definition). Also, the original array of scores should not be modified by any of the methods.

Suppose you are commissioned by the Australian Football Association (AFL) to write a program designed to produce statistics based on complete scores recorded in a season. These scores are kept in a file called afl.txt (available on interact resources). You are also given the following information about a football season:

League consists of 18 football teams

There are 22 rounds in each season

In each round teams play against each other and the score of each team is recorded as an integer and kept in the text file referred to above (aft.txt)

Your task is to write a complete java program (a java class with the main method) called ProcessScores, which will read the scores from the text file provided, store the scores in an array of integers and then using a number of independent static methods, calculate and display the required statistics relating the afl scores.

The java class you are required to author will contain the following static methods:

lowest will take the array of scores as an argument and return the lowest score in the season

highest will take the array of scores as an argument and return the highest score in the season

range will take the array of scores as an argument and return the difference between the highest score and the lowest score in the season

average will take the array of scores as an argument and return the average of all scores in the season

median will take the array of scores as an argument and return the median score in the season

mode will take the array of scores as an argument and return the mode of the scores in the season

Note that all of the methods described above, should be static methods; user defined methods (you have the write the definition of each yourself); and completely independent of each other (you should not invoke anyone of them within the other method definition). Also, the original array of scores should not be modified by any of the methods.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Databases On The Web Learn To Create Web Pages That Interface With Database Engines

Authors: Robert Papaj, Donald Burleson

11th Edition

1576100995, 978-1576100998

More Books

Students also viewed these Databases questions

Question

5. A review of the key behaviors is included.

Answered: 1 week ago