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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started