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

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
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
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education