Write a menu-based program (see menubased.java) that allows a user to manipulate
ID: 3638976 • Letter: W
Question
Write a menu-based program (see menubased.java) that allowsa user to manipulate a list of strings. That is, you should do
the following in your "main" method:
- Create a list (object) of strings.
- Add an initial set of strings (say, 3 to 5 of them) to the
list that you created. You choose the actual strings. You
can hard-code these strings in the "add" statements that
you write.
- Start the menu-based interaction with a menu that provides
these options:
1. Show list
2. Show list in reverse order
3. Show size of list
4. Insert a string
5. Remove a string
6. Remove all strings
7. Quit
Note that for Option 4 you will need to ask the user for the
string to be added. Additionally, for Options 4 and 5 you will
need to ask the user for the position number (index).
For Options 4 and 5, protect your program against a
crash by including try/catch constructs.