Question
Purpose : To learn how to use methods from the Arrays class and the arraycopy method from the System class. READ all instructions first before
Purpose: To learn how to use methods from the Arrays class and the arraycopy method from the System class. READ all instructions "first" before attempting to code. Name your program as YourLastNameFirstInitialLE64.java. Using an initializer list, create an Oscar categories array with the following values: "best picture", "best animated feature film", "best cinematography". Then do the following:
Use the arraycopy method in the System class to make a copy of the Oscar categories array.
Compare to see if the copy and the original are equal.
Sort the original Oscar categories array.
Again compare to see if the 2 arrays are equal.
Use the binarySearch method to search for an Oscar category in the original array.
Because the search is case sensitive make sure the Oscar categories already stored in the array are either all uppercase or all lowercase.
Also make sure to upper or lower case the Oscar category that you've chosen as the value for the search. Use a switch statement to determine which Oscar category is chosen from the prompt with the category list.
In a separate method that receives the 2 arrays, use the enhanced for loop to print their content.
***SAMPLE OUTPUT WITH OSCAR CATEGORY LOCATED***
The oscarCategories array equals the oscarCategoriesCopy array.
The oscarCategories array has been sorted.
The oscarCategories array doesn't equal the oscarCategoriesCopy array.
Which Oscar category are you looking for? 1. Best Picture 2. Best Animated Feature Film 3. Best Cinematography
Enter your choice: 2
Found BEST ANIMATED FEATURE FILM at element 0 in the oscarCategories array.
oscarCategories Array: best animated feature film best cinematography best picture
oscarCategoriesCopy Array: best picture best animated feature film best cinematography
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started