Advanced Programming Language Concepts (CT006-3-3) Programming with Collection
Tutorial -3
Question:
Given an array list as follows. Write a Java/Javascript statement for the following requirements.
[12,34,21,4,56,77,88,44,885,2,5,7,98,54]
1. Iterate and display through all elements of array list.
2. Search and display an element, ie., 885.
3. Double up each array element by 2 and store them in another array list.
4. Sort all elements in ascending order.
5. Sort all elements in descending order.
6. Generate numbers from 2 to 20 with a gap of 2. Join this generated numbers with the
array list above. Display all elements of the newly created array list.
7. Find and display all the elements that is greater than 10.
8. Find the minimum and maximum value.
9. Find the sum and average value of the list.
10. Find any even number on the list. Display the result either true or false.
Level 3 Asia Pacific University of Technology and Innovation Page 1 of 1