CSC 120 Programming Assignment 8 Option 2
Baseball Statistics

Note: You should not work on this assignment during class-time unless:
  1. You have completed all of the in-class assigned work for the day, and
  2. You have permission from the instructor.

This assignment must be handed in to your instructor's handin folder before the beginning of class on the due date.

Description:

Your program should accept input that represents statistics for some number of baseball players, convert this input into an array of BaseballPlayer objects, and display specific results obtained by processing the array.

Input format:

Each line of the input will consist of six values that will be separated by a # character.  The six values in order from left to right are:
Player Name   (a String)
Home Runs   (an Integer)
Batting Average   (a Double)
Base Hits   (an Integer)
Runs Batted In   (an Integer)
Stolen Bases   (an Integer)
Here is an example:
Aaron, Hank # 755 # .305 # 3771 # 2297 # 240
Note that you should use the trim method of the String class to remove all leading and trailing spaces from the parts of the input line that you split using "#" as the delimiter before processing the values in your program.

Array of Objects:

You will need to define a class in your NetBeans project to represent Baseball Players.  The class definition should have a private data member for each of the values shown above, a constructor method that accepts as many parameters as the class has private data members, a "getter" method for each private data member, and a toString method.

The input data should be stored in an array of Baseball Player objects.  See Lab # 12 for an example of how to do this.

Results of Processing to Display

The following should be displayed in the output text area, separated by several blank lines for readability:
  1. all of the data in the input, on separate lines (display the result of the toString method, so that all data are shown in the output area)
  2. all players who have hit 520 home runs or more
  3. all players who have a batting average of .310 or higher
  4. the single player with the most RBIs of any player in the input

Input Samples to Use:

Your program should be able to process both of these inputs correctly:
  1. Top 60 Home Run Hitters of all time
  2. Top 12 Batters of all time

It is expected that each student will complete this assignment INDIVIDUALLY.