Question: Cant seem to get the sorting to work #includeiostream 2 # include 3 using namespace std; 4 void buildarray(int arrll,int n); 5 void print boundaries()

Cant seem to get the sorting to work
 Cant seem to get the sorting to work #includeiostream 2 #
include 3 using namespace std; 4 void buildarray(int arrll,int n); 5 void
print boundaries() 6 void mystringCopy(char destination[], const char source ID 7 int
myStringLength(const char str[l); 8 void bubble sort(char str1[10119],int pos[10]): 9 int main()
11 I/keep track of names from input file and the position of

#includeiostream 2 # include 3 using namespace std; 4 void buildarray(int arrll,int n); 5 void print boundaries() 6 void mystringCopy(char destination[], const char source ID 7 int myStringLength(const char str[l); 8 void bubble sort(char str1[10119],int pos[10]): 9 int main() 11 I/keep track of names from input file and the position of number 12 char names from input[10119]: 13 int pos[10]: 14 buildarray(pos, 10): 15 Ifiles for input and output files to be entered by user 16 char input file[50] 17 char length file[50] 18 char alphabet file(501: 19 /Getting user, input 20 cout input file 22 cout length file; cout alphabet file; 26 file handLing 27 ifstream input stream; input stream.open(input file); /print to cout myst ringLength ( strli + i])) myStringCopy(temparr,stri[i]) mystringcopy(strili],strili 1]): myStringcopy(stri[i],temparr): temp pos[i]: pos[i] pos[i +1 pos [i +1] temp ; 100 161 rk- 103 104 in order true; else 06 07 109 Example Input File (Names.txt) Contents: Victor Eve Juliet Hector Danielle Romeo Oscar unc Ares Dannac Example Output (to Terminal and/or File): Unsorted Data (Original Input Order and Name) 0 Victor 1 Eve 2 Juliet 3 Hector 4 Danielle 5 Romeco 6 Oscar 7 June 8 Ares 9 Dannac Sorted-by-Length Data (Original Input Order and Name) 1 Eve une 8 Ares 5 Romeo 6 Oscar 0 Victor 2 Juliet 3 Hector 9 Dannac 4 Danielle #includeiostream 2 # include 3 using namespace std; 4 void buildarray(int arrll,int n); 5 void print boundaries() 6 void mystringCopy(char destination[], const char source ID 7 int myStringLength(const char str[l); 8 void bubble sort(char str1[10119],int pos[10]): 9 int main() 11 I/keep track of names from input file and the position of number 12 char names from input[10119]: 13 int pos[10]: 14 buildarray(pos, 10): 15 Ifiles for input and output files to be entered by user 16 char input file[50] 17 char length file[50] 18 char alphabet file(501: 19 /Getting user, input 20 cout input file 22 cout length file; cout alphabet file; 26 file handLing 27 ifstream input stream; input stream.open(input file); /print to cout myst ringLength ( strli + i])) myStringCopy(temparr,stri[i]) mystringcopy(strili],strili 1]): myStringcopy(stri[i],temparr): temp pos[i]: pos[i] pos[i +1 pos [i +1] temp ; 100 161 rk- 103 104 in order true; else 06 07 109 Example Input File (Names.txt) Contents: Victor Eve Juliet Hector Danielle Romeo Oscar unc Ares Dannac Example Output (to Terminal and/or File): Unsorted Data (Original Input Order and Name) 0 Victor 1 Eve 2 Juliet 3 Hector 4 Danielle 5 Romeco 6 Oscar 7 June 8 Ares 9 Dannac Sorted-by-Length Data (Original Input Order and Name) 1 Eve une 8 Ares 5 Romeo 6 Oscar 0 Victor 2 Juliet 3 Hector 9 Dannac 4 Danielle

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!