Question: Write a program (class) that reads in a list of up to 25 first names from an input file nameData.txt, stores them in an array,

 Write a program (class) that reads in a list of up

Write a program (class) that reads in a list of up to 25 first names from an input file nameData.txt, stores them in an array, outputs the number of names read, and outputs the list in original, ascending, and descending orders (see example output below). Write the following two methods to help with the processing: public static void displayNames(final Stringl] names, final int count): // displays a list of names public static void reverseNames(Stringl] names, final int count); /reverses a list of names Hint: use java.util.Arrays.sort(Object[] a, int fromindex, int tolndex) to sort the array in ascending order first then display it, then reverse the order with an appropriate loop in your reverse method and finally display it again. You do NOT need to handle any Exceptions with this lab Screen INPUT/OUTPUT should be formatted as follows (example below is for the provided nameData.txt file) Number of names read is Names read are: George John Jane Andre Frank Mark Mary Paul Sorted ascending names are: Andrew Frank George Jane John Mark Mary Paul Sorted descending names are: Paul Mary Page 1 of 2

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!