Question: Write in JAVA In a baseball an array of 9 players circulates until team achieves a possible 27 outs . Team will have 25 Players

Write in JAVA

In a baseball an array of 9 players circulates until team achieves a possible 27 outs .

Team will have 25 Players able to play. Files are provided, but you can make your own. They are tab delimited files. Fields are #, Name, B/T, Ht, Wt, DOB, and Position. # is the player number which appears on the jersey. Ht is their height, Wt represents weight, DOB is date of birth. B/T stands for batting stance (right or left or bat either side).

Team can start with 25 players, only 9 will be a part of the starting line up for a team. Print out batting order of a team. In 9 players there should be 1 pitcher, 1 catcher, 3 outfield and 4 infield players.

This is my code, what i have so far:

import java.io.*; import java.util.ArrayList; import java.util.Scanner; public class BaseballGame { private String fileName;

public BaseballGame(String fileName) {

this.fileName = fileName; } public String getFileName() { return fileName; }

public void setFileName(String fileName) { this.fileName = fileName; }

// Open file and read values into Array List public ArrayList readFile()throws IOException{ ArrayList players = new ArrayList(); File file = new File(getFileName()); Scanner reader = new Scanner(file);

try { while(reader.hasNext()) { String name = reader.nextLine(); players.add(name); } }catch(Exception ex) { System.out.println(ex.getMessage()); } reader.close(); return players;

// Add your code here // read players file and print out their batting order // until team reaches 27 possible outs.

}

Write in JAVA In a baseball an array of 9 players circulates

Ht 6'2" 6'7" 6'8" 6'0" 6'4" R/R 6'2" 5'10" 6'3" 6'3" 6'2" 6'1" R/R L/L 5'11" 6'6" 6'2" Yankees - Notepad File Edit Format View Help Name B/T Albert Abreu R/R Domingo Acevedo R/R Dellin Betances R/R Luis Cessa R/R Aroldis Chapman L/L Giovanny Gallegos Domingo German R/R Sonny Gray R/R Chad Green L/R Ben Heller R/R Jonathan Holder R/R Tommy Kahnle R/R Jonathan Loaisiga Jordan Montgomery David Robertson R/R CC Sabathia L/L Luis Severino R/R Chasen Shreve L/L Masahiro Tanaka R/R Adam Warren R/R Kyle Higashioka R/R Austin Romine R/R Gary Sanchez R/R Miguel Andujar R/R Tyler Austin R/R Greg Bird L/R Thairo Estrada R/R Didi Gregorius L/R Gleyber Torres R/R Ronald Torreyes R/R Tyler Wade L/R Jabari Blash R/R Jake Cave L/L Jacoby Ellsbury L/L Clint Frazier R/R Brett Gardner L/L Aaron Hicks S/R Aaron Judge R/R Billy McKinney L/L Giancarlo Stanton 6'4" 6'3" 6'1" 6'1" 6'1" 6'2" 6'0" Wt DOB Position 175lbs 9/26/95 Pitchers 250lbs 3/6/94 Pitchers 265lbs 3/23/88 Pitchers 205lbs 4/25/92 Pitchers 212lbs 2/28/88 Pitchers 6'2" 210lbs 8/14/91 Pitchers 175lbs 8/4/92 Pitchers 190lbs 11/7/89 Pitchers 210lbs 5/24/91 Pitchers 205lbs 8/5/91 Pitchers 235lbs 6/9/93 Pitchers 235lbs 8/7/89 Pitchers 5'11" 165lbs 11/2/94 Pitchers 6'6" 225lbs 12/27/92 Pitchers 195lbs 4/9/85 Pitchers 300lbs 7/21/80 Pitchers 215lbs 2/20/94 Pitchers 195lbs 7/12/90 Pitchers 215lbs 11/1/88 Pitchers 224lbs 8/25/87 Pitchers 200lbs 4/20/90 Catchers 220lbs 11/22/88 Catchers 230lbs 12/2/92 Catchers 215lbs 3/2/95 Infield 220lbs 9/6/91 Infield 220lbs 11/9/92 Infield 185lbs 2/22/96 Infield 205lbs 2/18/90 Infield 175lbs 12/13/96 Infield 151lbs 9/2/92 Infield 185lbs 11/23/94 Infield 235lbs 7/4/89 Outfield 200lbs 12/4/92 Outfield 195lbs 9/11/83 Outfield 190lbs 9/6/94 Outfield 195lbs 8/24/83 Outfield 2021bs 10/2/89 Outfield 282lbs 4/26/92 Outfield 205lbs 8/23/94 Outfield 6'6" 245lbs 11/8/89 Outfield 6'2" 6'4" 5'10" 6'3" 6'1" 5'8" 6'1" 6'5" 6'0" 6'1" 6'1" 5'11" 6'1" 6'7" 6'1" R/R Ln 19, Col 51 100% Windows (CRLF) UTF-8 Ht 6'2" 6'7" 6'8" 6'0" 6'4" R/R 6'2" 5'10" 6'3" 6'3" 6'2" 6'1" R/R L/L 5'11" 6'6" 6'2" Yankees - Notepad File Edit Format View Help Name B/T Albert Abreu R/R Domingo Acevedo R/R Dellin Betances R/R Luis Cessa R/R Aroldis Chapman L/L Giovanny Gallegos Domingo German R/R Sonny Gray R/R Chad Green L/R Ben Heller R/R Jonathan Holder R/R Tommy Kahnle R/R Jonathan Loaisiga Jordan Montgomery David Robertson R/R CC Sabathia L/L Luis Severino R/R Chasen Shreve L/L Masahiro Tanaka R/R Adam Warren R/R Kyle Higashioka R/R Austin Romine R/R Gary Sanchez R/R Miguel Andujar R/R Tyler Austin R/R Greg Bird L/R Thairo Estrada R/R Didi Gregorius L/R Gleyber Torres R/R Ronald Torreyes R/R Tyler Wade L/R Jabari Blash R/R Jake Cave L/L Jacoby Ellsbury L/L Clint Frazier R/R Brett Gardner L/L Aaron Hicks S/R Aaron Judge R/R Billy McKinney L/L Giancarlo Stanton 6'4" 6'3" 6'1" 6'1" 6'1" 6'2" 6'0" Wt DOB Position 175lbs 9/26/95 Pitchers 250lbs 3/6/94 Pitchers 265lbs 3/23/88 Pitchers 205lbs 4/25/92 Pitchers 212lbs 2/28/88 Pitchers 6'2" 210lbs 8/14/91 Pitchers 175lbs 8/4/92 Pitchers 190lbs 11/7/89 Pitchers 210lbs 5/24/91 Pitchers 205lbs 8/5/91 Pitchers 235lbs 6/9/93 Pitchers 235lbs 8/7/89 Pitchers 5'11" 165lbs 11/2/94 Pitchers 6'6" 225lbs 12/27/92 Pitchers 195lbs 4/9/85 Pitchers 300lbs 7/21/80 Pitchers 215lbs 2/20/94 Pitchers 195lbs 7/12/90 Pitchers 215lbs 11/1/88 Pitchers 224lbs 8/25/87 Pitchers 200lbs 4/20/90 Catchers 220lbs 11/22/88 Catchers 230lbs 12/2/92 Catchers 215lbs 3/2/95 Infield 220lbs 9/6/91 Infield 220lbs 11/9/92 Infield 185lbs 2/22/96 Infield 205lbs 2/18/90 Infield 175lbs 12/13/96 Infield 151lbs 9/2/92 Infield 185lbs 11/23/94 Infield 235lbs 7/4/89 Outfield 200lbs 12/4/92 Outfield 195lbs 9/11/83 Outfield 190lbs 9/6/94 Outfield 195lbs 8/24/83 Outfield 2021bs 10/2/89 Outfield 282lbs 4/26/92 Outfield 205lbs 8/23/94 Outfield 6'6" 245lbs 11/8/89 Outfield 6'2" 6'4" 5'10" 6'3" 6'1" 5'8" 6'1" 6'5" 6'0" 6'1" 6'1" 5'11" 6'1" 6'7" 6'1" R/R Ln 19, Col 51 100% Windows (CRLF) UTF-8

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!