Task
This problem creates a list containing names. The list of names will be printed, sorted, printed again in the new sorted order, written to a new output file, and searched. Carefully read chapter 8 to find examples of the techniques and functions you need to solve this problem. You must design your solution using these 4 sub-functions:
1) Input the names from the data file names.txt (which is located in the Homework 8 folder in D2L) into a list and return the list to main.
2) Print the names one per line and single-spaced. Call this function (twice) passing the list of names to it for printing before and after they are sorted (do the sorting in main).
3) Pass the sorted list of names to a function which writes the list to a new output file (use a name different than the input file’s name) with one name per line.
4) Pass the sorted list of names to a function which asks the user to enter a name and then indicate whether the name entered is found in the list or not. If the name is found in the list, its position (i.e. index) is also printed.
The data file for this program contains 30 names each with the format Last, First. This value is to be processed as one, not separately. The user enters the search name in this same format as one string (i.e. not separately as Last and First names) unless your program is coded to concatenate them appropriately. Use Notepad to look at (and print) the test data file names.txt.
When testing your program, use the last and first names in the list along with one in the middle. Also test for one not in the list. Open the new output file with Notepad to verify that it contains the sorted list of names, one per line.
For 5 extra credit points, create a loop so the user can enter additional names to be searched for without having to rerun the entire program (show this loop in the logic diagram and include it in your program).
Submit each of the following in electronic format following class standards inside a compressed folder using the D2L drop boxes for Homework 8.
Use the logic diagrams drop box to submit:
1. A hierarchy chart drawn with MS-Visio. (2 points)
2. Program flowcharts drawn with MS-Visio showing your logical solution. (9 points)
Use the program drop box to submit:
3. A Python program implementing the solution shown in your logic diagrams. (14 points)