Question: Write a Java program that does the following: main() calls a method to print a heading for a table. Use a file called names.txt for

Write a Java program that does the following:

main() calls a method to print a heading for a table.

Use a file called names.txt for the input. It contains up to 15 full names in the form

first last. main() calls a method to read the full names into an array.

For each name in the array:

main() sbreaks up the name into first and last.

main() stores last in a new array.

main() sends the first last form to a method. The method returns the name (through a return statement) in the form first---last.

main() calls a method to print a row in the chart in the form first last last, first first---last .

for example: Abe Adams Adams, Abe Abe---Adams

main() calls a method to print the array of last names.

main() asks the user to enter a last name and calls a method to determine if the last name is in the array. main() prints the result.

main() calls bubbleSort() to sort the array of last names in non-ascending order.

main() calls the same method as above to print the array of last names, again.

Use three names of various lengths to test your program. Run it again with 5 names of various lengths. Run your program with one name that is in the list and one that is not.

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!