Machine Problem #10. Write a method-oriented Java program using the concept of string ArrayList, create a dynamic ArrayList that initially asks the user to input the size of the ArrayList and input the given elements. After inputting all the values, a menu selection will be displayed for different ArrayList operations. Class Name: MethodDynamicArrayList What is the size of the ArrayList? 5 Enter the values: 12 13 14 15 16 Press the letter for specific operation. A – Adding element to List/ Add element C- Changing elements/ Set element R- Removing elements/Delete element I- Iterating elements G- get elements E- add elements in between two numbers S- Sorting elements Z - ArrayList size If Option A was chosen Type your option: A You want to add a new element. Enter the element you want to add: 12 The ArrayList elements now are: [12, 13, 14, 15, 16, 12] If Option B was chosen Type your option: C You want to change new element. Enter the index of the element you want to change: 1 Enter the new value: 100 The ArrayList elements now are: [12, 100, 14, 15, 16] 7 If Option R was chosen Type your option: R You will remove or delete the element. Enter the index of the element you want to delete: 1 The ArrayList elements now are: [12, 14, 15, 16} If Option I was chosen Type your option: I You want to iterate the ArrayList elements. The ArrayList elements are: [12, 13, 14, 15, 16} If Option G was chosen You want to get the ArrayList elements. The ArrayList elements are: 12 13 14 15 16 If Option E was chosen You want to add elements in between two numbers. Beginning index: 1 Ending index: 2 Enter the value of the element to be inserted: 8 The ArrayList elements are: [12, 13, 14, 8, 15, 16, 12] If Option S was chosen You want to sort the elements of the Array List The original arrangements: [12, 13, 14, 15, 16] Sorted ArrayList: [12, 13, 14, 15, 16] 8 If Option Z was chosen You want to know the size of the ArrayList The ArrayList size is: 5

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 16PE: The implementation of a queue in an array, as given in this chapter, uses the variable count to...
icon
Related questions
Question
100%

 

Machine Problem #10. Write a method-oriented Java program using the concept of string
ArrayList, create a dynamic ArrayList that initially asks the user to input the size of the
ArrayList and input the given elements. After inputting all the values, a menu selection will be
displayed for different ArrayList operations.

Class Name: MethodDynamicArrayList

What is the size of the ArrayList? 5
Enter the values:
12
13
14
15
16
Press the letter for specific operation.
A – Adding element to List/ Add element
C- Changing elements/ Set element
R- Removing elements/Delete element
I- Iterating elements
G- get elements
E- add elements in between two numbers
S- Sorting elements
Z - ArrayList size
If Option A was chosen
Type your option: A
You want to add a new element.
Enter the element you want to add: 12
The ArrayList elements now are:
[12, 13, 14, 15, 16, 12]
If Option B was chosen
Type your option: C
You want to change new element.
Enter the index of the element you want to change: 1
Enter the new value: 100
The ArrayList elements now are:
[12, 100, 14, 15, 16]

7

If Option R was chosen
Type your option: R
You will remove or delete the element.
Enter the index of the element you want to delete: 1
The ArrayList elements now are:
[12, 14, 15, 16}
If Option I was chosen
Type your option: I
You want to iterate the ArrayList elements.
The ArrayList elements are:
[12, 13, 14, 15, 16}
If Option G was chosen
You want to get the ArrayList elements.
The ArrayList elements are:
12 13 14 15 16

If Option E was chosen
You want to add elements in between two numbers.
Beginning index: 1
Ending index: 2
Enter the value of the element to be inserted: 8
The ArrayList elements are:
[12, 13, 14, 8, 15, 16, 12]
If Option S was chosen
You want to sort the elements of the Array List
The original arrangements: [12, 13, 14, 15, 16]
Sorted ArrayList: [12, 13, 14, 15, 16]

8

If Option

Z was chosen

You want to know the size of the ArrayList
The ArrayList size is: 5

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Knowledge Booster
Arrays
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning