Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need help programming the main args. I am not sure what to do after I create an array list and scanner. h import java.util.ArrayList;

I need help programming the main args. I am notimage text in transcribed sure what to do after I create an array list and scanner.image text in transcribedh

import java.util.ArrayList; import java.util.Scanner; public class Fantasy Football public static void main(string] args) ArrayList availablePlayers - new ArrayList0; addPlayers (avallablePlayers), Stringt roster; roster = new String[5]; Scanner player = new Scanner(System.in); System.out.println("Enter Player you would like on your tein: "); String playeri - player.nextLine(); public static int search(ArrayListString> array, String player) for (int i = 0; i array) array.Add("Can Newton"); array.add("Antonio Brown); array.add("Leveon Bell"); array.add("Patrick Mahomes"); array.add("Saquom Barkley"); array.Add("Nike Evans"); array.add("Odell Beckhar Jr."); array.add("Travis Kelce"); array.add("Baker Mayfield" array.add("Nichael Thomas"): array.add("Julio Jones"); array.add("Ezekial Elliott"); array.add("Alvin Kamara"); array.add("Davante Adaes"; array.Add("Aaron Rogers"); Create a program that allows you to create a fantasy football roster based on the existing list of available players. Your team can only have 5 players, so create an array that can store 5 possible players. Prompt the user to pick 5 players to add to their team. If the player is available in the list of availablePlayers, then add that player to the users array, and remove that player from the availablePlayers list. Then prompt the user to pick another player. Once all five players have been added, then print the list in the console. Create a search method to find the index at which the player is located in the availablePlayers list so you can remove the player, and make sure that they are an eligible pick. Here is a sample run of the program: Enter Player you would like on your team: Cam Newton Great! That player is added to your team! Enter Player you would like on your team: Travis Kelce Great! That player is added to your team! Enter Player you would like on your team: Alvin Kamara Great! That player is added to your team! Enter Player you would like on your team: Alvin Kamara That player is not available, please pick another player. Enter Player you would like on your team: Patrick Mahomes Great! That player is added to your team! Enter Player you would like on your team: Mike Evans Great! That player is added to your team! Your team is: Cam Newton Travis Kelce Alvin Kamara Patrick Mahomes Mike Evans

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

Database Processing Fundamentals Design And Implementation

Authors: David M. Kroenke

5th Edition

B000CSIH5A, 978-0023668814

More Books

Students also viewed these Databases questions

Question

Distinguish between hearing and listening.

Answered: 1 week ago

Question

Use your voice effectively.

Answered: 1 week ago