Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In java using arrays try to do as simple as can be following every direction The Name Game Lab objective To read, search and sort,

In java using arrays try to do as simple as can be following every direction image text in transcribed
image text in transcribed
image text in transcribed
The Name Game Lab objective To read, search and sort, an Array of strings Assignment Download the following 2 files from Blackboard. Make sure you save both of the files in the same folder. period2.ixt or period3.txt depending on which class you are in. Name Game java The text file contains a list of all the students in your class (first name only). The java program will read the list of names from the text file and store each name in an array. Your assignment is to write the body of the 4 methods defined in the NamoG java file. Below is a description of the task of each method. ame print List Public static void printlist (Stringt) array) This method should print a list of all the names in the array numbered For example 2 Sally 3 Harry shuffle public static void shuffle (Stringti array) This method should mix up all the elenents in the array one way to shuttle a list is to pick 2 random elements in your list and swap them Repeat thia proceno 20 time or search public static int search (string 1 array, string key This method the array the You should perform a linear or tial search on the starting from the element position to the end of the array. If you find the "key" in the array, then you should return the position of the key. If you do not find the "key" in the array then you should return a value of (negative one averageLength public static double averageLength string (I array This method should return the average length of the names in the 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

Database Systems Design Implementation And Management

Authors: Carlos Coronel, Steven Morris

14th Edition

978-0357673034

More Books

Students also viewed these Databases questions