Arrays
Arrays
1.) Identify any task in your approved project that can be done using
arrays be it a 1D or 2D array of at least 10 elements. Create a
minimum of 2 arrays with different data types in the main method and
initialize the values of each element in the array by inputting it using
the Scanner class. Create a method for printing the elements of the
array and call it in method main to check its contents. (50 Points).
package activities;
import java.util.*;
System.out.println("=====================================================
================================================\n");
}
showWarning();
showGratitude();
scan.close();
}
}
2.) Improve your code in item no.1 to include a method for searching
and sorting elements in the array. Also create another method to check
if the elements of the array are sorted or not. Use the 3 methods
mentioned inside the main method by calling it so that the user can
search a desired element in the array and display appropriate results.
(Note: Select only one type of array from item no.1 and make sure that
your program will sort the elements in the array if it is not sorted
before searching the desired element inputted by the user. But if the
elements are already sorted it will directly search that element.) (50
Points).
package activities;
import java.util.*;
System.out.println("=====================================================
================================================\n");
}
showWarning();
showGratitude();
scan.close();
}
}