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.

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

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
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