Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Beginning Programming C++ #include #include using namespace std; void selectionSort(string[], int ); void dispArray(string[], int ); int main() { const int NUM_NAMES = 20; string
Beginning Programming C++
#include#include using namespace std; void selectionSort(string[], int); void dispArray(string[], int); int main() { const int NUM_NAMES = 20; string names[NUM_NAMES] = {"Collins, Bill", "Smith, Bart", "Allen, Jim", "Griffin, Jim", "Stamey, Marty", "Rose, Geri", "Taylor, Terri", "Johnson, Jill", "Allison, Jeff", "Looney, Joe", "Wolfe, Bill", "James, Jean", "Weaver, Jim", "Pore, Bob", "Rutherford, Greg", "Javens, Renee", "Harrison, Rose", "Setzer, Cathy", "Pike, Gordon", "Holland, Beth"}; cout void selectionSort(string names[], int size) { int mindInd; string temp; for(int i = 0; i for(int j = i+1; j if(names[j] void dispArray(string names[], int size) { for(int i = 0; i
The above program is for question 6. Can you please help me with question 11.
6. String Selection Sort Modify the selectionSort function presented in this chapter so it sorts an array of strings instead of an array of ints. Test the function with a driver program. Use Program 8-8 as a skeleton to complete. Program 8-8 #include#include using namespace std; int main) const int NUM_NAMES 20; string names [NUM_NAMES]("Collins, Bill", "Smith, Bart, "A11en, Jim", Griffin, Jim", "Stamey, Marty" "Rose, Geri", Taylor, Terri", "Johnson, Jill", "Allison, Jeff", "Looney,Joe", "Wolfe, Bil1", James, Jean", "Weaver, Jim"Pore, Bob" Rutherford, Greg" "Javens, Renee" "Harrison, Rose*, "Setzer, Cathy" "Pike , Gordon", "Holland , Beth" }; II Insert your code to complete this program return 0; 11. Using Files-String Selection Sort Modification Modify the program you wrote for Programming Challenge 6 (String Selection Sort) so it reads in 20 strings from a file. The data can be found in the names.txt 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