Question: C++ Write a program that reads in 10 names from a file. It should call a function that uses the selection sort algorithm to sort
C++
Write a program that reads in 10 names from a file. It should call a function that uses the selection sort algorithm to sort the array of strings in ascending order. The function should keep a count of the number of exchanges it makes. The data can be found in the names.txt file.
Your program should call the displayArray function to display the contents of the array. It should also call the readNames function to read the contents of the "names.txt" file into the array.
Use the following function prototypes.
Write a program that reads in 10 names from a file. It should call a function that uses the selection sort algorithm to sort the array of strings in ascending order. The function should keep a count of the number of exchanges it makes. The data can be found in the names.txt file.
Your program should call the displayArray function to display the contents of the array. It should also call the readNames function to read the contents of the "names.txt" file into the array.
Use the following function prototypes.
Write a program that reads in 10 names from a file. It should call a function that uses the selection sort algorithm to sort the array of strings in ascending order. The function should keep a count of the number of exchanges it makes. The data can be found in the names.txt file.
Your program should call the displayArray function to display the contents of the array. It should also call the readNames function to read the contents of the "names.txt" file into the array.
Use the following function prototypes.
Write a program that reads in 10 names from a file. It should call a function that uses the selection sort algorithm to sort the array of strings in ascending order. The function should keep a count of the number of exchanges it makes. The data can be found in the names.txt file.
Your program should call the displayArray function to display the contents of the array. It should also call the readNames function to read the contents of the "names.txt" file into the array.
Use the following function prototypes.
Write a program that reads in 10 names from a file. It should call a function that uses the selection sort algorithm to sort the array of strings in ascending order. The function should keep a count of the number of exchanges it makes. The data can be found in the names.txt file.
Your program should call the displayArray function to display the contents of the array. It should also call the readNames function to read the contents of the "names.txt" file into the array.
Use the following function prototypes.
Write a program that reads in 10 names from a file. It should call a function that uses the selection sort algorithm to sort the array of strings in ascending order. The function should keep a count of the number of exchanges it makes. The data can be found in the names.txt file.
Your program should call the displayArray function to display the contents of the array. It should also call the readNames function to read the contents of the "names.txt" file into the array.
Use the following function prototypes.
void selectionSort(string [], int); void displayArray(string [], int); void readNames(string[], int);
Use the following function prototypes.
void selectionSort(string [], int); void displayArray(string [], int); void readNames(string[], int);
Make your code selfdocumenting, using appropriate indentation, style, and comments.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
