Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Hey, can anyone help me with this project? It is an java assignment java file public class ArraySkills { public static void main(String[] args) {

Hey, can anyone help me with this project?

It is an java assignment

java file

public class ArraySkills { public static void main(String[] args) { // *********************** // 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[] 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" their name from index 4 // 4. Fill 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 or 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 array 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 larger than the first, print forward in the array from the first index to the second. } }

image text in transcribed

1. Create an array for a given data type 2. Add items to an array at a given index 3. Add items sequentially to an array (the next open spot available) 4. Make sure items don't get added to an index that is out of bounds 5. Loop through and access all items in an array from front to back and back to front 6. Loop through a small part (subset or slice) of an array from front to back and back to front 7. Access and modify items in an array 8. Remove items from an array 9. Sequentially search for items in an array from the beginning 10. Accumulate all of the values in an array (find the average of an array of numbers or add up the cost of an array of products) 11. Find the largest and smallest items in an array 12. "Resize" an array when it runs out of space 13. Move (shift) items around in an array when an item is removed so there are no gaps in the array. 14. Shuffle an array 15. Swap the position of two items in an array

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Data Analysis In Microsoft Excel

Authors: Alex Holloway

1st Edition

B0CCCPKTTX, 979-8852388452

More Books

Students also viewed these Databases questions