[SOLVED] COMP1210 Project 11

25.00 $

Category:
Click Category Button to View Your Next Assignment | Homework

You will receive the following solution file(s) instantly after successful payment:

zip file icon P11-Exceptions-z3zxag.zip (277 KB)
Assignment Instructions Updated Recently? Submit Below and we will provide new Solution!
Submit New Instructions
πŸ”’ Securely Powered by:
Secure Checkout
5/5 - (1 vote)

From Project 9 originally, but should be copied from Project 10
β€’ SoftballPlayer.java
β€’ Outfielder.java, OutfielderTest.java
β€’ Infielder.java, InfielderTest.java
β€’ Pitcher.java, PitcherTest.java
β€’ ReliefPitcher.java, ReliefPitcherTest.java
From Project 10
β€’ NameComparator.java, NameComparatorTest.java
β€’ RatingComparator.java, RatingComparatorTest.java
β€’ SoftballTeam.java, SoftballTeamTest.java [must be modified as described below]
New in Project 11
β€’ InvalidCategoryException.java
β€’ SoftballPlayersPart3.java, SoftballPlayersPart3Test.java

Recommendations
You should create a new folder for Part 3 and copy your relevant Part 2 source and test files to it. You should create a jGRASP project and add the class and test files as they are created.

Specifications – Use arrays in this project; ArrayLists are not allowed!
Overview: This project is Part 3 of three that involves the rating and reporting for softball players. In Part 1 (Project 9), you developed Java classes including an abstract SoftballPlayer class and subclasses of it that represent categories of softball players: outfielders, infielders, pitchers, and relief pitchers. In Part 2 (Project 10), you implemented three additional classes: (1) NameComparator that implements the Comparator interface for SoftallPlayer, (2) RatingComparator that implements the Comparator interface for SoftballPlayer, and (3) SoftballTeam that represents a team of softball players and includes several specialized methods. In Part 3 (Project 11), you are to add exception handling. You will need to do the following: (1) create a new class named InvalidCategoryException which extends the Exception class, (2) add try-catch statements to catch IOException in the main method of the SoftballPlayersPart3 class, and (3) modify the readPlayerFile in the SoftballTeam class to catch/handle InvalidCategoryException and NumberFormatException in the event that either type exception is thrown while reading the input file.

Note that the main method in SoftballPlayersPart3 should create a SoftballTeam object and then invoke the readPlayerFile method on the SoftballTeam object to read data from a file and add softball players to the team. You can use SoftballPlayersPart3 in conjunction with interactions by running the program in the canvas (or debugger with a breakpoint) and single stepping until the variables of interest are created. You can then enter interactions in the usual way. In addition to the source files, you will create a JUnit test file for the indicated source files and write one or more test methods to ensure the classes and methods meet the specifications. You should create a jGRASP project upfront and then add the source files as they are created. All of your files should be in a single folder.

β€’ SoftballPlayer, Outfielder, Infielder, Pitcher, ReliefPitcher, NameComparator, RatingComparator

Requirements and Design: No changes from the specifications in Projects 9 and 10. .

β€’ InvalidCategoryException.java

Requirements and Design: InvalidCategoryException is a user defined exception created by extending the Exception class. This exception is to be thrown and caught in the readPlayerFile method in the SoftballTeam class when a line of input data contains an invalid player category. The constructor for InvalidCategoryException takes a single String parameter representing category and invokes the super constructor with the following String:
“For category: ” + “”” + category + “””
This string will be the toString() value of an InvalidCategoryException when it occurs. For a similar constructor, see InvalidLengthException.java in 11_ExceptionsExamplesPolygons from this week’s class notes.

β€’ SoftballTeam.java

Requirements and Design: The SoftballTeam class provides methods for reading in the data file and generating reports.

Design: In addition to the specifications in Project 10, the existing readPlayerFile method must be modified to catch following: InvalidCategoryException and NumberFormatException.

o readPlayerFile has no return value and accepts the data file name as a String. Remember to include the throws IOException clause in the method declaration. This method creates a Scanner object to read in the file and then reads it in line by line. The first line contains the team name and each of the remaining lines contains the data for a player. After reading in the team name, the β€œplayer” lines should be processed as follows. A player line is read in, a second scanner is created on the line, and the individual values for the player are read in. After the values on the line have been read in, an β€œappropriate” SoftballPlayer object created. If there is room on the roster, the player is added to the roster array and the
player count is incremented. Any player lines/records read from the file after the limit of MAX_PLAYERS players has been reached should be added to the excluded array with appropriate prefix message (Maximum player count of ___ exceeded for:
where the blank is MAX_PLAYERS) and its count should be incremented. If excluded array is full, the line/record should just be skipped, and the ignored count should be incremented. The data file is a β€œcomma separated values” file; i.e., if a line contains multiple values, the values are delimited by commas. So when you set up the scanner for the player lines, you need to set the delimiter to use a β€œ,” by calling the useDelimiter(“,”) method on the Scanner object. Each player line in the file begins with a category for the softball player (O, I, P, and R are valid categories for softball players indicating Outfielder, Infielder, Pitcher, and ReliefPitcher respectively. The second field in the record is the player’s number, followed by the data for the name, position, specialization factor, and batting average. The last items correspond to the data needed for the particular category (or subclass) of SoftballPlayer. For each incorrect line scanned (i.e., a line of data contains an invalid category or invalid numeric data), your method will need to handle the invalid items properly. If the line of data begins with an invalid category, your program should throw an
InvalidCategoryException (see description above). If a line of data has a valid category, but includes invalid numeric data (e.g., the value for battingAvg contains an alphabetic character), a NumberFormatException (see notes on last page) will be thrown automatically by the Java Runtime Environment (JRE). The code that checks for player category should be in a try statement and the code that adds a record with an invalid player category to the excluded records array should now be placed in the catch clause that follows the try statement. That is, your readPlayerFile method should catch and handle
InvalidCategoryException and NumberFormatException as follows. In each catch clause, a
String object should be created consisting of e + ” in: ” + line
where e is the exception and line is the line with the invalid data. The String object should be added to the excludedRecords array.

The file softball_player_data3a.csv is available for download from the course web site.
Below are example data records (the first line/record containing the team name is followed by player lines/records). Note that the last two lines will each cause an exception to be thrown. L is an invalid category and .480a in not a double value.

Auburn Stars
O,32,Pat Jones,RF,1.0,.375,.950
I,23,Jackie Smith,3B,1.25,.275,.850
P,43,Jo Williams,RHP,2.0,.125,22,4,2.85
R,34,Sammi James,LHP,2.0,.125,5,4,3.85,17
L,23,Gayle Adams,2B,1.25,.225,.875
O,09,Pat Williams,RF,1.0,.480a,.950

β€’ SoftballPlayersPart3.java

Requirements and Design: The SoftballPlayersPart3 class has only a main method as described below. In addition to the specifications in Project 10, the main method should be modified to catch and handle an IOException if one is thrown in the readPlayerFile method.

o As before, main reads in the file name as the first argument, args[0], of the command line arguments, creates an instance of SoftballTeam, and then calls the readPlayerFile method in the SoftballTeam class to read in the data file and generate the five reports as shown in the output examples beginning on the next page. The main method should not include the throws IOException in the declaration. Instead, the main method should include a try-catch statement to catch IOException when/if it is thrown in the readPlayerFile method in the SoftballPlayer class. This exception is most likely to occur when an incorrect file name is passed to the readPlayerFile method. After this exception is caught and the appropriate message is printed in main, your program should end. See the second example output on the following page.

Example data files can be downloaded from the Lab web page, and the program output for softball_player_data3a.csv, softball_player_data3b.csv, and softball_player_data3c.csv begins on the next page.

Example Output when file name is missing as command line argument

MMΒ«M —-jGRASP exec: java SoftballPlayersPart3 MMΒ§MFile name expected as command line argument. MMΒ§MProgram ending.
MMΒ§M MMΒ©M —-jGRASP: operation complete.

Example Output when attempting to read a file that is not found

MMΒ«M —-jGRASP exec: java SoftballPlayersPart3 not_a_real_file.csv MMΒ§MAttempted to read file: not_a_real_file.csv (No such file or directory) MMΒ§MProgram ending.
MMΒ§M
MMΒ©M —-jGRASP: operation complete.

Example Output for softball_player_data_part3a.csv

MMΒ«M —-jGRASP exec: java SoftballPlayersPart3 softball_player_data_part3a.csv
MMΒ§M
MMΒ§M————————————— MMΒ§MTeam Report for Auburn Stars
MMΒ§M—————————————
MMΒ§M
MMΒ§M32 Pat Jones (RF) .375
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 3.562
MMΒ§M
MMΒ§M23 Jackie Smith (3B) .275
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 2.922
MMΒ§M
MMΒ§M43 Jo Williams (RHP) 22 wins, 4 losses, 2.85 ERA
MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: 3.740
MMΒ§M
MMΒ§M34 Sammi James (LHP) 5 wins, 4 losses, 17 saves, 3.85 ERA MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 2.474 MMΒ§M
MMΒ§M
MMΒ§M—————————————
MMΒ§MTeam Report for Auburn Stars (by Number)
MMΒ§M—————————————
MMΒ§M23 Jackie Smith 3B .275
MMΒ§M32 Pat Jones RF .375
MMΒ§M34 Sammi James LHP 5 wins, 4 losses, 17 saves, 3.85 ERA
MMΒ§M43 Jo Williams RHP 22 wins, 4 losses, 2.85 ERA MMΒ§M
MMΒ§M————————————— MMΒ§MTeam Report for Auburn Stars (by Name)
MMΒ§M—————————————
MMΒ§M34 Sammi James LHP 5 wins, 4 losses, 17 saves, 3.85 ERA
MMΒ§M32 Pat Jones RF .375
MMΒ§M23 Jackie Smith 3B .275
MMΒ§M43 Jo Williams RHP 22 wins, 4 losses, 2.85 ERA MMΒ§M
MMΒ§M—————————————
MMΒ§MTeam Report for Auburn Stars (by Rating)
MMΒ§M—————————————
MMΒ§M3.74 43 Jo Williams RHP 22 wins, 4 losses, 2.85 ERA
MMΒ§M3.56 32 Pat Jones RF .375
MMΒ§M2.92 23 Jackie Smith 3B .275
MMΒ§M2.47 34 Sammi James LHP 5 wins, 4 losses, 17 saves, 3.85 ERA
MMΒ§M
MMΒ§M————————————— MMΒ§MExcluded Records Report
MMΒ§M—————————————
MMΒ§MInvalidCategoryException: For category: “L” in: L,23,Gayle Adams,2B,1.25,.225,.875
MMΒ§Mjava.lang.NumberFormatException: For input string: “.480a” in: O,09,Pat Williams,RF,1.0,.480a,.950 MMΒ§MNumber of ignored records from file: 0
MMΒ§M
MMΒ©M —-jGRASP: operation complete.

Example Output for softball_player_data_part3b.csv

MMΒ«M —-jGRASP exec: java SoftballPlayersPart3 softball_player_data_part3b.csv
MMΒ§M
MMΒ§M————————————— MMΒ§MTeam Report for My Bigger Team
MMΒ§M—————————————
MMΒ§M
MMΒ§M21 Jodi Doe (RF) .305
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 2.989
MMΒ§M
MMΒ§M11 Tina Dobbs (RF) .350
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 3.395
MMΒ§M
MMΒ§M13 Nina Dobbs (LF) .478
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 4.541
MMΒ§M
MMΒ§M12 Poppi Ledet (LF) .325
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 3.120
MMΒ§M
MMΒ§M14 Sruthi Yalamanchili (CF) .285
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 2.679
MMΒ§M
MMΒ§M29 Sandy Chintapalli (1B) .265
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 2.915
MMΒ§M
MMΒ§M18 Buddy Bell (2B) .325
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 3.494
MMΒ§M
MMΒ§M19 Gigi de la Hoya (2B) .278
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 3.301
MMΒ§M
MMΒ§M10 Mikie Mahtook (3B) .298
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 3.464
MMΒ§M
MMΒ§M22 Matty Ott (SS) .298
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 3.278
MMΒ§M
MMΒ§M23 Leah Coleman (SS) .350
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 4.244
MMΒ§M
MMΒ§M25 Erin Noland (RHP) 5 wins, 11 losses, 4.3 ERA
MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: -.906
MMΒ§M
MMΒ§M26 Jackie Malkovic (RHP) 6 wins, 10 losses, 5.4 ERA MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: -.500
MMΒ§M
MMΒ§M27 Lois Gibson (RHP) 8 wins, 7 losses, 3.5 ERA
MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: .178
MMΒ§M
MMΒ§M28 Gina Malika (LHP) 7 wins, 8 losses, 1.6 ERA

MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: -.308
MMΒ§M
MMΒ§M16 Tika Brando (LHP) 9 wins, 7 losses, 1.7 ERA
MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: .593
MMΒ§M
MMΒ§M30 Belinda Striker (LHP) 10 wins, 6 losses, 10 saves, 1.8 ERA MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.333
MMΒ§M
MMΒ§M31 Lilly Dean (RHP) 11 wins, 5 losses, 3 saves, 1.9 ERA MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 2.069
MMΒ§M
MMΒ§M32 Briana Wilson (RHP) 4 wins, 4 losses, 14 saves, 2.0 ERA
MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.111
MMΒ§M
MMΒ§M33 Janine Mason (RHP) 5 wins, 3 losses, 12 saves, 2.1 ERA MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.011
MMΒ§M
MMΒ§M34 Green Lantern (LHP) 14 wins, 2 losses, 3 saves, 2.2 ERA
MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.125
MMΒ§M
MMΒ§M35 Bruce Wayne (LHP) 15 wins, 1 losses, 4 saves, 2.3 ERA
MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.636
MMΒ§M
MMΒ§M36 Billie Gates (LHP) 16 wins, 0 losses, 2 saves, 2.4 ERA MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.529 MMΒ§M
MMΒ§M
MMΒ§M—————————————
MMΒ§MTeam Report for My Bigger Team (by Number)
MMΒ§M—————————————
MMΒ§M10 Mikie Mahtook 3B .298
MMΒ§M11 Tina Dobbs RF .350
MMΒ§M12 Poppi Ledet LF .325
MMΒ§M13 Nina Dobbs LF .478
MMΒ§M14 Sruthi Yalamanchili CF .285
MMΒ§M16 Tika Brando LHP 9 wins, 7 losses, 1.7 ERA
MMΒ§M18 Buddy Bell 2B .325
MMΒ§M19 Gigi de la Hoya 2B .278
MMΒ§M21 Jodi Doe RF .305
MMΒ§M22 Matty Ott SS .298
MMΒ§M23 Leah Coleman SS .350
MMΒ§M25 Erin Noland RHP 5 wins, 11 losses, 4.3 ERA
MMΒ§M26 Jackie Malkovic RHP 6 wins, 10 losses, 5.4 ERA
MMΒ§M27 Lois Gibson RHP 8 wins, 7 losses, 3.5 ERA
MMΒ§M28 Gina Malika LHP 7 wins, 8 losses, 1.6 ERA
MMΒ§M29 Sandy Chintapalli 1B .265
MMΒ§M30 Belinda Striker LHP 10 wins, 6 losses, 10 saves, 1.8 ERA
MMΒ§M31 Lilly Dean RHP 11 wins, 5 losses, 3 saves, 1.9 ERA
MMΒ§M32 Briana Wilson RHP 4 wins, 4 losses, 14 saves, 2.0 ERA MMΒ§M33 Janine Mason RHP 5 wins, 3 losses, 12 saves, 2.1 ERA
MMΒ§M34 Green Lantern LHP 14 wins, 2 losses, 3 saves, 2.2 ERA
MMΒ§M35 Bruce Wayne LHP 15 wins, 1 losses, 4 saves, 2.3 ERA MMΒ§M36 Billie Gates LHP 16 wins, 0 losses, 2 saves, 2.4 ERA
MMΒ§M
MMΒ§M—————————————
MMΒ§MTeam Report for My Bigger Team (by Name)
MMΒ§M—————————————
MMΒ§M18 Buddy Bell 2B .325
MMΒ§M16 Tika Brando LHP 9 wins, 7 losses, 1.7 ERA
MMΒ§M29 Sandy Chintapalli 1B .265
MMΒ§M23 Leah Coleman SS .350
MMΒ§M19 Gigi de la Hoya 2B .278
MMΒ§M31 Lilly Dean RHP 11 wins, 5 losses, 3 saves, 1.9 ERA MMΒ§M13 Nina Dobbs LF .478
MMΒ§M11 Tina Dobbs RF .350
MMΒ§M21 Jodi Doe RF .305
MMΒ§M36 Billie Gates LHP 16 wins, 0 losses, 2 saves, 2.4 ERA
MMΒ§M27 Lois Gibson RHP 8 wins, 7 losses, 3.5 ERA
MMΒ§M34 Green Lantern LHP 14 wins, 2 losses, 3 saves, 2.2 ERA
MMΒ§M12 Poppi Ledet LF .325
MMΒ§M10 Mikie Mahtook 3B .298
MMΒ§M28 Gina Malika LHP 7 wins, 8 losses, 1.6 ERA
MMΒ§M26 Jackie Malkovic RHP 6 wins, 10 losses, 5.4 ERA
MMΒ§M33 Janine Mason RHP 5 wins, 3 losses, 12 saves, 2.1 ERA
MMΒ§M25 Erin Noland RHP 5 wins, 11 losses, 4.3 ERA
MMΒ§M22 Matty Ott SS .298
MMΒ§M30 Belinda Striker LHP 10 wins, 6 losses, 10 saves, 1.8 ERA
MMΒ§M35 Bruce Wayne LHP 15 wins, 1 losses, 4 saves, 2.3 ERA MMΒ§M32 Briana Wilson RHP 4 wins, 4 losses, 14 saves, 2.0 ERA
MMΒ§M14 Sruthi Yalamanchili CF .285
MMΒ§M
MMΒ§M—————————————
MMΒ§MTeam Report for My Bigger Team (by Rating)
MMΒ§M—————————————
MMΒ§M4.54 13 Nina Dobbs LF .478
MMΒ§M4.24 23 Leah Coleman SS .350
MMΒ§M3.64 35 Bruce Wayne LHP 15 wins, 1 losses, 4 saves, 2.3 ERA
MMΒ§M3.53 36 Billie Gates LHP 16 wins, 0 losses, 2 saves, 2.4 ERA
MMΒ§M3.49 18 Buddy Bell 2B .325
MMΒ§M3.46 10 Mikie Mahtook 3B .298
MMΒ§M3.39 11 Tina Dobbs RF .350
MMΒ§M3.33 30 Belinda Striker LHP 10 wins, 6 losses, 10 saves, 1.8 ERA
MMΒ§M3.30 19 Gigi de la Hoya 2B .278
MMΒ§M3.28 22 Matty Ott SS .298
MMΒ§M3.12 34 Green Lantern LHP 14 wins, 2 losses, 3 saves, 2.2 ERA MMΒ§M3.12 12 Poppi Ledet LF .325
MMΒ§M3.11 32 Briana Wilson RHP 4 wins, 4 losses, 14 saves, 2.0 ERA
MMΒ§M3.01 33 Janine Mason RHP 5 wins, 3 losses, 12 saves, 2.1 ERA
MMΒ§M2.99 21 Jodi Doe RF .305
MMΒ§M2.92 29 Sandy Chintapalli 1B .265
MMΒ§M2.68 14 Sruthi Yalamanchili CF .285
MMΒ§M2.07 31 Lilly Dean RHP 11 wins, 5 losses, 3 saves, 1.9 ERA
MMΒ§M0.59 16 Tika Brando LHP 9 wins, 7 losses, 1.7 ERA
MMΒ§M0.18 27 Lois Gibson RHP 8 wins, 7 losses, 3.5 ERA
MMΒ§M-0.31 28 Gina Malika LHP 7 wins, 8 losses, 1.6 ERA
MMΒ§M-0.50 26 Jackie Malkovic RHP 6 wins, 10 losses, 5.4 ERA
MMΒ§M-0.91 25 Erin Noland RHP 5 wins, 11 losses, 4.3 ERA MMΒ§M
MMΒ§M————————————— MMΒ§MExcluded Records Report
MMΒ§M—————————————
MMΒ§Mjava.lang.NumberFormatException: For input string: “1.0a” in: O,15,Kavya Krishnappa,CF,1.0a,0.298,0.93
MMΒ§Mjava.lang.NumberFormatException: For input string: “0.350b” in: I,17,Janie Doe,1B,1.25,0.350b,0.97 MMΒ§Mjava.lang.NumberFormatException: For input string: “0.94c” in: I,20,Daisy Doalot,3B,1.25,0.285,0.94c MMΒ§MInvalidCategoryException: For category: “H” in: H,24,Nola Austin,LHP,2.0,0.225,4,12,1.2 MMΒ§MNumber of ignored records from file: 0
MMΒ§M
MMΒ©M —-jGRASP: operation complete.

Example Output for softball_player_data3c.csv

MMΒ«M —-jGRASP exec: java SoftballPlayersPart3 softball_player_data_part3c.csv
MMΒ§M
MMΒ§M————————————— MMΒ§MTeam Report for My Biggest Team File MMΒ§M—————————————
MMΒ§M
MMΒ§M21 Jodi Doe (RF) .305
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 2.989
MMΒ§M
MMΒ§M11 Tina Dobbs (RF) .350
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 3.395 MMΒ§M

MMΒ§M13 Nina Dobbs (LF) .478
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 4.541
MMΒ§M
MMΒ§M12 Poppi Ledet (LF) .325
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 3.120
MMΒ§M
MMΒ§M14 Sruthi Yalamanchili (CF) .285
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 2.679
MMΒ§M
MMΒ§M29 Sandy Chintapalli (1B) .265
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 2.915
MMΒ§M
MMΒ§M18 Codi Bell (2B) .325
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 3.494
MMΒ§M
MMΒ§M19 Gigi de la Hoya (2B) .278
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 3.301
MMΒ§M
MMΒ§M10 Mikie Mahtook (3B) .298
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 3.464
MMΒ§M
MMΒ§M22 Matty Ott (SS) .298
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 3.278
MMΒ§M
MMΒ§M23 Leah Coleman (SS) .350
MMΒ§MSpecialization Factor: 1.25 (class Infielder) Rating: 4.244
MMΒ§M
MMΒ§M25 Erin Noland (RHP) 5 wins, 11 losses, 4.3 ERA
MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: -.906
MMΒ§M
MMΒ§M26 Jackie Malkovic (RHP) 6 wins, 10 losses, 5.4 ERA MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: -.500
MMΒ§M
MMΒ§M27 Lois Gibson (RHP) 8 wins, 7 losses, 3.5 ERA
MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: .178
MMΒ§M
MMΒ§M28 Gina Malika (LHP) 7 wins, 8 losses, 1.6 ERA
MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: -.308
MMΒ§M
MMΒ§M16 Tika Brando (LHP) 9 wins, 7 losses, 1.7 ERA
MMΒ§MSpecialization Factor: 2.0 (class Pitcher) Rating: .593
MMΒ§M
MMΒ§M30 Belinda Striker (LHP) 10 wins, 6 losses, 10 saves, 1.8 ERA MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.333
MMΒ§M
MMΒ§M31 Lilly Dean (RHP) 11 wins, 5 losses, 3 saves, 1.9 ERA MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 2.069
MMΒ§M
MMΒ§M32 Briana Wilson (RHP) 4 wins, 4 losses, 14 saves, 2.0 ERA
MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.111
MMΒ§M
MMΒ§M33 Janine Mason (RHP) 5 wins, 3 losses, 12 saves, 2.1 ERA MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.011
MMΒ§M
MMΒ§M34 Green Lantern (LHP) 14 wins, 2 losses, 3 saves, 2.2 ERA
MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.125
MMΒ§M
MMΒ§M35 Brice Wayne (LHP) 15 wins, 1 losses, 4 saves, 2.3 ERA
MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.636
MMΒ§M
MMΒ§M36 Billie Gates (LHP) 16 wins, 0 losses, 2 saves, 2.4 ERA MMΒ§MSpecialization Factor: 2.0 (class ReliefPitcher) Rating: 3.529
MMΒ§M
MMΒ§M37 Anita Jones (RF) .375
MMΒ§MSpecialization Factor: 1.0 (class Outfielder) Rating: 3.562 MMΒ§M
MMΒ§M
MMΒ§M—————————————
MMΒ§MTeam Report for My Biggest Team File (by Number)

MMΒ§M—————————————
MMΒ§M10 Mikie Mahtook 3B .298
MMΒ§M11 Tina Dobbs RF .350
MMΒ§M12 Poppi Ledet LF .325
MMΒ§M13 Nina Dobbs LF .478
MMΒ§M14 Sruthi Yalamanchili CF .285
MMΒ§M16 Tika Brando LHP 9 wins, 7 losses, 1.7 ERA
MMΒ§M18 Codi Bell 2B .325
MMΒ§M19 Gigi de la Hoya 2B .278
MMΒ§M21 Jodi Doe RF .305
MMΒ§M22 Matty Ott SS .298
MMΒ§M23 Leah Coleman SS .350
MMΒ§M25 Erin Noland RHP 5 wins, 11 losses, 4.3 ERA
MMΒ§M26 Jackie Malkovic RHP 6 wins, 10 losses, 5.4 ERA
MMΒ§M27 Lois Gibson RHP 8 wins, 7 losses, 3.5 ERA
MMΒ§M28 Gina Malika LHP 7 wins, 8 losses, 1.6 ERA
MMΒ§M29 Sandy Chintapalli 1B .265
MMΒ§M30 Belinda Striker LHP 10 wins, 6 losses, 10 saves, 1.8 ERA
MMΒ§M31 Lilly Dean RHP 11 wins, 5 losses, 3 saves, 1.9 ERA
MMΒ§M32 Briana Wilson RHP 4 wins, 4 losses, 14 saves, 2.0 ERA MMΒ§M33 Janine Mason RHP 5 wins, 3 losses, 12 saves, 2.1 ERA
MMΒ§M34 Green Lantern LHP 14 wins, 2 losses, 3 saves, 2.2 ERA
MMΒ§M35 Brice Wayne LHP 15 wins, 1 losses, 4 saves, 2.3 ERA
MMΒ§M36 Billie Gates LHP 16 wins, 0 losses, 2 saves, 2.4 ERA
MMΒ§M37 Anita Jones RF .375
MMΒ§M
MMΒ§M—————————————
MMΒ§MTeam Report for My Biggest Team File (by Name)
MMΒ§M—————————————
MMΒ§M18 Codi Bell 2B .325
MMΒ§M16 Tika Brando LHP 9 wins, 7 losses, 1.7 ERA
MMΒ§M29 Sandy Chintapalli 1B .265
MMΒ§M23 Leah Coleman SS .350
MMΒ§M19 Gigi de la Hoya 2B .278
MMΒ§M31 Lilly Dean RHP 11 wins, 5 losses, 3 saves, 1.9 ERA
MMΒ§M13 Nina Dobbs LF .478
MMΒ§M11 Tina Dobbs RF .350
MMΒ§M21 Jodi Doe RF .305
MMΒ§M36 Billie Gates LHP 16 wins, 0 losses, 2 saves, 2.4 ERA
MMΒ§M27 Lois Gibson RHP 8 wins, 7 losses, 3.5 ERA
MMΒ§M37 Anita Jones RF .375
MMΒ§M34 Green Lantern LHP 14 wins, 2 losses, 3 saves, 2.2 ERA
MMΒ§M12 Poppi Ledet LF .325
MMΒ§M10 Mikie Mahtook 3B .298
MMΒ§M28 Gina Malika LHP 7 wins, 8 losses, 1.6 ERA
MMΒ§M26 Jackie Malkovic RHP 6 wins, 10 losses, 5.4 ERA
MMΒ§M33 Janine Mason RHP 5 wins, 3 losses, 12 saves, 2.1 ERA
MMΒ§M25 Erin Noland RHP 5 wins, 11 losses, 4.3 ERA
MMΒ§M22 Matty Ott SS .298
MMΒ§M30 Belinda Striker LHP 10 wins, 6 losses, 10 saves, 1.8 ERA
MMΒ§M35 Brice Wayne LHP 15 wins, 1 losses, 4 saves, 2.3 ERA MMΒ§M32 Briana Wilson RHP 4 wins, 4 losses, 14 saves, 2.0 ERA
MMΒ§M14 Sruthi Yalamanchili CF .285
MMΒ§M
MMΒ§M—————————————
MMΒ§MTeam Report for My Biggest Team File (by Rating)
MMΒ§M—————————————
MMΒ§M4.54 13 Nina Dobbs LF .478
MMΒ§M4.24 23 Leah Coleman SS .350
MMΒ§M3.64 35 Brice Wayne LHP 15 wins, 1 losses, 4 saves, 2.3 ERA
MMΒ§M3.56 37 Anita Jones RF .375
MMΒ§M3.53 36 Billie Gates LHP 16 wins, 0 losses, 2 saves, 2.4 ERA
MMΒ§M3.49 18 Codi Bell 2B .325
MMΒ§M3.46 10 Mikie Mahtook 3B .298
MMΒ§M3.39 11 Tina Dobbs RF .350
MMΒ§M3.33 30 Belinda Striker LHP 10 wins, 6 losses, 10 saves, 1.8 ERA MMΒ§M3.30 19 Gigi de la Hoya 2B .278
MMΒ§M3.28 22 Matty Ott SS .298
MMΒ§M3.12 34 Green Lantern LHP 14 wins, 2 losses, 3 saves, 2.2 ERA
MMΒ§M3.12 12 Poppi Ledet LF .325
MMΒ§M3.11 32 Briana Wilson RHP 4 wins, 4 losses, 14 saves, 2.0 ERA
MMΒ§M3.01 33 Janine Mason RHP 5 wins, 3 losses, 12 saves, 2.1 ERA
MMΒ§M2.99 21 Jodi Doe RF .305
MMΒ§M2.92 29 Sandy Chintapalli 1B .265
MMΒ§M2.68 14 Sruthi Yalamanchili CF .285
MMΒ§M2.07 31 Lilly Dean RHP 11 wins, 5 losses, 3 saves, 1.9 ERA
MMΒ§M0.59 16 Tika Brando LHP 9 wins, 7 losses, 1.7 ERA
MMΒ§M0.18 27 Lois Gibson RHP 8 wins, 7 losses, 3.5 ERA
MMΒ§M-0.31 28 Gina Malika LHP 7 wins, 8 losses, 1.6 ERA
MMΒ§M-0.50 26 Jackie Malkovic RHP 6 wins, 10 losses, 5.4 ERA
MMΒ§M-0.91 25 Erin Noland RHP 5 wins, 11 losses, 4.3 ERA MMΒ§M
MMΒ§M————————————— MMΒ§MExcluded Records Report
MMΒ§M—————————————
MMΒ§Mjava.lang.NumberFormatException: For input string: “1.0a” in: O,15,Kavya Krishnappa,CF,1.0a,0.298,0.93
MMΒ§Mjava.lang.NumberFormatException: For input string: “0.350b” in: I,17,Janie Doe,1B,1.25,0.350b,0.97
MMΒ§Mjava.lang.NumberFormatException: For input string: “0.94c” in: I,20,Daisy Doalot,3B,1.25,0.285,0.94c
MMΒ§MInvalidCategoryException: For category: “H” in: H,24,Nola Austin,LHP,2.0,0.225,4,12,1.2
MMΒ§MMaximum player count of 24 exceeded for: O,38,Betty Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,39,Cate Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,40,Dee Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,41,Edie Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,42,Fay Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,43,Gigit Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,44,Hattie Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,45,Isabel Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,46,Jane Jones,RF,1.0,.375,.950 MMΒ§MMaximum player count of 24 exceeded for: O,47,Kathy Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,48,Lola Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,49,Mary Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,50,Nina Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,51,Olivia Jones,RF,1.0,.375,.950 MMΒ§MMaximum player count of 24 exceeded for: O,52,Pat Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,53,Quie Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,54,Reta Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,55,Siena Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,56,Tina Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,57,Ubi Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,58,Victoria Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,59,Willow Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,60,Xena Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,61,Yani Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,62,Zeta Jones,RF,1.0,.375,.950
MMΒ§MMaximum player count of 24 exceeded for: O,63,Zaata Jones,RF,1.0,.375,.950 MMΒ§MNumber of ignored records from file: 5
MMΒ§M
MMΒ©M —-jGRASP: operation complete.

Notes:
1. This project assumes that you are reading each double value as a String using next() and then parsing it into a double with Double.parseDouble(…) as shown in the following example.
. . . Double.parseDouble(myInput.next());
This form of input will throw a java.lang.NumberFormatException if the value is not a double.

If you are reading in each double value as a double using nextDouble(), for example
. . . myInput.nextDouble(); then a java.util.InputMismatchException will be thrown if the value read in is not a double.

For this assignment, you should change your input to use Double.parseDouble(…) rather than nextDouble(), since Web-CAT is looking for NumberFormatException rather than java.util.InputMismatchException.

2. If you are using the JUnit Assert.assertArrayEquals method to check two Cardholder arrays for equality, then the equals and hashCode methods must be implemented in your Cardholder class; that is, Assert.assertArrayEquals calls equals(Object obj) on each object in the array, so Cardholder must have an equals method that overrides the one inherited from the Object class. If Cardholder does not override equals(Object obj), then the JUnit Assert.assertArrayEquals method will use the inherited equals(Object obj) method which means two Cardholder arrays will be equal only if they are aliases.

Below is a simplified equals method and hashCode method you are free to use.

public boolean equals(Object obj) { if (!(obj instanceof SoftballPlayer)) { return false;
} else {
Cardholder c = (SoftballPlayer) obj; return (name.equalsIgnoreCase(c.getName()));
}
}
public int hashCode() { return 0;
}

  • P11-Exceptions-z3zxag.zip