Question: Exercise 1: Write a program that generates a sequence of 20 random values between 0 and 99 in an array, prints the sequence, sortsit and

 Exercise 1: Write a program that generates a sequence of 20
random values between 0 and 99 in an array, prints the sequence,

Exercise 1: Write a program that generates a sequence of 20 random values between 0 and 99 in an array, prints the sequence, sortsit and prints the sorted sequence. Use the sort method from the standard Java library. Hint: import java.util.Arays int[are 45 Array.sort(Arra 101 102 Exercise 2: Write a program that stores a list of countries "Egypt" Switzerland "Argentina" "Spain" "Portugal" "Luxemburg". etc ess Initialize your array with a single statement Then print out the array Use the sont function as before to sort the countries in alphabetical order and Reprint your array Enter your search term Initialize your array with a single statement. Then print out the array Use the sort function as before to sort the countries in alphabetical order Reprint your array Exercise 3: Implement exercises 1 and 2 using ArrayList. Use the Collections sort method for sorting. After you have printed and sorted your results, then append an additional element to each list and reprint your ArrayLists. Notice that the new items will appear just at the end and will not be sorted. Resort and print out the new ArrayLists again, To clarify, you should print out your ArrayLists after your first sort, after adding items with the unsorted item, then after sorting again Submission Instructions

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!