The goal of this lab is to help you get familiar with sorting data in an array
This lab exercise involves writing a short program to do the following:
void selectionSort(string values[], int size);
Swap [indexA] stringA with [indexB] stringB
Input file: firstTen.txt
Washington, George
Adams, John
Jefferson, Thomas
Madison, James
Monroe, James
Adams, John Quincy
Jackson, Andrew
Van Buren, Martin
Harrison, William Henry
Tyler, John
Output from processing the firstTen.txt file
Enter name of input file: firstTen.txt
10 lines of text read from input file.
Here are the unsorted names:
--------------------------
[ 0] Washington, George
[ 1] Adams, John
[ 2] Jefferson, Thomas
[ 3] Madison, James
[ 4] Monroe, James
[ 5] Adams, John Quincy
[ 6] Jackson, Andrew
[ 7] Van Buren, Martin
[ 8] Harrison, William Henry
[ 9] Tyler, John
Swap [ 1] Adams, John with [ 0] Washington, George
Swap [ 5] Adams, John Quincy with [ 1] Washington, George
Swap [ 8] Harrison, William Henry with [ 2] Jefferson, Thomas
Swap [ 6] Jackson, Andrew with [ 3] Madison, James
Swap [ 8] Jefferson, Thomas with [ 4] Monroe, James
Swap [ 6] Madison, James with [ 5] Washington, George
Swap [ 8] Monroe, James with [ 6] Washington, George
Swap [ 9] Tyler, John with [ 7] Van Buren, Martin
Swap [ 9] Van Buren, Martin with [ 8] Washington, George
Number of "swap" operations = 9
Here are the names sorted:
--------------------------
[ 0] Adams, John
[ 1] Adams, John Quincy
[ 2] Harrison, William Henry
[ 3] Jackson, Andrew
[ 4] Jefferson, Thomas
[ 5] Madison, James
[ 6] Monroe, James
[ 7] Tyler, John
[ 8] Van Buren, Martin
[ 9] Washington, George
Exit the program.