Question: Write a program, called sort_file, which takes a text file as input and produces an output file which has all the original lines in alphabetical

Write a program, called sort_file, which takes a text file as input and produces an output file which has all the original lines in alphabetical order. The program should do the following: Prompt the user for the names of the input and output files. You can prepare an input file with appropriate unsorted data. A simple file with one word per line will suffice. Declare and define three functions to perform the following tasks: Read the data from the input file into an array. Sort the array using the bubble sort algorithm. Write the sorted data array to the output file.

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!