Write java program that does the following steps. Part 1: Array list implementation: array list implements list interface plus their own functions. 1. a. Create a ArrayList of type Integer and name it as Grades. b. Create a ArrayList of type String and name it as Students. c. Create a ArrayList of type Double and name it as Results. 2. Add the following values to the array List using add function 30, 40,80 ,100,70,100,10,100,10 Print the size of the array list using size () function. 3.Search for 100 in the array list, if you find it, print a message that “those grades are perfect”. Use only contains function. 4. Repeat the step 3 using equals function. 5. Check if array list is empty or not using isEmpty() function. Print a message if it’s empty and if it’s not empty also. 6. the grade is under 20 which is outlier, remove it from the array list. 7. Print array list using System.out.println() 8. Use indexOf to print index of 80. 9. Use get function. 10. What is the difference between get and index of? 11. Print the values of the array list using Iterator class. 12.. Delete all the values of the array list using clear function. 13. Print all the values of the array after you execute clear using System.out.println(). what is the result of using clear function? 14. What is the shortcoming of using array List? Part2: LinkedList implementation: linked list implements list interface plus their own functions. 1. Create a linked list of type String Not Object and name it as StudentName. 2. Add the following values to linked list above Jack Omar Jason. 3. Use addFirst to add the student Mary. 4. Use addLast to add the student Emily.  5. Print linked list using System.out.println(). 6. Print the size of the linked list. 7. Use removeLast. 8. Print the linked list using for loop for (String anobject: StudentName){…..} This question will not be in the quiz 9. Print the linked list using Iterator class. 10. Does linked list hava capacity function? Provide the answer in the comment. 11. Create another linked list of type String Not Object and name it as TransferStudent. 12. Add the following values to TransferStudent linked list Sara Walter. 13. Add the content of linked list TransferStudent to the end of the linked list StudentName 14. Print StudentName. 15. Print TransferStudent. 16. What is the shortcoming of using Linked List? Part 3: Vector implementation: vector implements list interface plus their own functions. 1. Create vector of default capacity 10 and name it v1. 2. Add NJ NY CA to v1. 3. Print the capacity and size of v1. 4. Create vector of default capacity 20 and name it v2. 5. Print the capacity and size of v2. 6. Create vector of default capacity 2 and increment is 2, name it v3. 7. Print the capacity and size of v3. 8. Add values 100 200 300 to v3. 9. Print the capacity and size of v3.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Write java program that does the following steps.

Part 1: Array list implementation: array list implements list interface plus their own functions.

1. a. Create a ArrayList of type Integer and name it as Grades.

b. Create a ArrayList of type String and name it as Students.

c. Create a ArrayList of type Double and name it as Results.

2. Add the following values to the array List using add function 30, 40,80 ,100,70,100,10,100,10 Print the size of the array list using size () function.

3.Search for 100 in the array list, if you find it, print a message that “those grades are perfect”. Use only contains function.

4. Repeat the step 3 using equals function.

5. Check if array list is empty or not using isEmpty() function. Print a message if it’s empty and if it’s not empty also.

6. the grade is under 20 which is outlier, remove it from the array list.

7. Print array list using System.out.println()

8. Use indexOf to print index of 80.

9. Use get function.

10. What is the difference between get and index of?

11. Print the values of the array list using Iterator class.

12.. Delete all the values of the array list using clear function.

13. Print all the values of the array after you execute clear using System.out.println(). what is the result of using clear function?

14. What is the shortcoming of using array List?

Part2: LinkedList implementation: linked list implements list interface plus their own functions.

1. Create a linked list of type String Not Object and name it as StudentName.

2. Add the following values to linked list above Jack Omar Jason.

3. Use addFirst to add the student Mary.

4. Use addLast to add the student Emily. 

5. Print linked list using System.out.println().

6. Print the size of the linked list.

7. Use removeLast.

8. Print the linked list using for loop for (String anobject: StudentName){…..} This question will not be in the quiz

9. Print the linked list using Iterator class.

10. Does linked list hava capacity function? Provide the answer in the comment.

11. Create another linked list of type String Not Object and name it as TransferStudent.

12. Add the following values to TransferStudent linked list Sara Walter.

13. Add the content of linked list TransferStudent to the end of the linked list StudentName

14. Print StudentName.

15. Print TransferStudent.

16. What is the shortcoming of using Linked List?

Part 3: Vector implementation: vector implements list interface plus their own functions.

1. Create vector of default capacity 10 and name it v1.

2. Add NJ NY CA to v1.

3. Print the capacity and size of v1.

4. Create vector of default capacity 20 and name it v2.

5. Print the capacity and size of v2.

6. Create vector of default capacity 2 and increment is 2, name it v3.

7. Print the capacity and size of v3.

8. Add values 100 200 300 to v3.

9. Print the capacity and size of v3.

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY