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.

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter17: Linked Lists
Section: Chapter Questions
Problem 18PE
icon
Related questions
Question

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?

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Follow-up Questions
Read through expert solutions to related follow-up questions below.
Follow-up Question

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? 

Solution
Bartleby Expert
SEE SOLUTION
Knowledge Booster
Concept of memory addresses in pointers
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