Using an ArrayList, create a program which does the following: If the user enters quit, the...

60.1K

Verified Solution

Question

Programming

Using an ArrayList, create a program which does the following:If the user enters quit, the program ends. If the user enters addfollowed by a string, program adds the string only to yourArrayList. If the user enters print, the program prints out theArrayList contents. If the user enters size, the program prints outsize of ArrayList, If the user enters remove followed by string, itremoves all strings.

interface example:

**** Welcome to my List Program ****

Options: quit, add and a string, size, and print

Enter option: add bill jackson

bill jackson added to list

Enter option: print

[bill jackson]

Enter option: size

Size of List is: 1

Enter option: add jim jones

jim jones added to list

Enter option: print

[bill jackson, jim jones]

Enter option: search jim jones

jim jones found in index 1

Enter option: search billy billkins

billy billkins not found

Enter option: remove jim jones

jim jones removed

Enter option: print

[bill jackson]

Enter option: remove nick

nick not found - not removed

Enter option: remove all nick

all nick removed

Enter option: quit

Thank You!

Answer & Explanation Solved by verified expert
4.1 Ratings (479 Votes)
please give thumbs up thankscodeimport    See Answer
Get Answers to Unlimited Questions

Join us to gain access to millions of questions and expert answers. Enjoy exclusive benefits tailored just for you!

Membership Benefits:
  • Unlimited Question Access with detailed Answers
  • Zin AI - 3 Million Words
  • 10 Dall-E 3 Images
  • 20 Plot Generations
  • Conversation with Dialogue Memory
  • No Ads, Ever!
  • Access to Our Best AI Platform: Flex AI - Your personal assistant for all your inquiries!
Become a Member

Other questions asked by students