Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Objectives . Be able to use ArrayList. Task: Write a program that uses an ArrayList to manage a namelist. o In the main method, create

image text in transcribed
Objectives . Be able to use ArrayList. Task: Write a program that uses an ArrayList to manage a namelist. o In the main method, create an ArrayList object that can hold only String object. o Read the following name list from a file to an ArrayList. There is no need to keep track of the number of items that have been added to the list. Jillian Gagandeep Kari Darius Sierra Jarrell Harvey Camron Brittney Victor o Print the namelist on Screen (use toString method of the ArrayList Class) and display how many items in the list. o Write code to add "Michael" to the end of the list. Print a relevant message and current namelist. o Write code to add "Lucy" to the list in position 2. Print a relevant message and current namelist. o Write code to find "Michael" in the list (indexOf method of the ArrayList Class) and replace it with "Mike". Print a relevant message and current namelist. o Ask the user for a name to delete from the list. If the name was not found in the list, print a message saying that the name was not in the list. If it was found, delete the name, print a relevant message and current namelist

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

Financial management theory and practice

Authors: Eugene F. Brigham and Michael C. Ehrhardt

12th Edition

978-0030243998, 30243998, 324422695, 978-0324422696

Students also viewed these Programming questions