Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Please review my code in the link. And let me know the corrections needed to make it work. I am not sure about some of
Please review my code in the link. And let me know the corrections needed to make it work. I am not sure about some of the answers as I am learning.
My code here so far https://paste.ofcode.org/55yZSgAyKRing6KK94fNWL
You MUST put your code directly beneath the comment for each item indicated This assignment will give you the opportunity to demonstrate your ability to perform a number of the array operations. You cannot use the ArrayList class, any helper methods from the Java. Arrays package, or any other library public class Arrayskills public static void main(String CJ arg For each item below, you must code the solution. You may not use any of the methods found in the Arrays class or the collections classes String CJ myData; 1. Instantiate the given array to hold 10 Strings 2. Add your name to the Array at index 0 and a friend's name to the Array at index 4 3. Move your friend's name to index 0 in the array and delete the name from index 4 4. 1 up all of the remaining indeces in the array with more names 5. swap the values at index 5 and index 1 6. Print the array from beginning to end. 7. Shuffle the array of strings 8. Find and print the longest and shortest strings in the array 9. Add up the total number of characters in all of the strings in the array and print the answer 10. Prompt the user for a String and then perform a linear search of the array to see if that string is on is not in the array. Print if it is or is not found 11 Remove the item at index 4 of the array by shifting everything after it one spot to the left This means your array should have one empty index at the end after the shift (delete the duplicate item at the end). 12. create a new array that is twice as big as the current array, and copy all of the items to the new array when complete, swap references so our old gets garbage collected and the new array is pointed to by your array variable myData 13. Prompt the user to enter 2 numbers within the range of the array's length. If the first is larger than the second print backwards from that index to the first If the second is anger than the first, print forward in the array from the first index to the second
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