Ch. 19 Programming Assignment

    Ch19Proj1.cpp

    Write a C++ program that allows the user to use five common sorting algorithms on 100 arbitrary integer values read from a sequential access file named Ch19Proj1data.txt. The data in Ch19Proj1data.txt will consist of 100 integer values on separate lines. Your program must use separate void functions named sequentialSort, insertionSort, bubbleSort, quickSort, and mergeSort to implement those common sorting algorithms. The data must be read into an apvector which must then be passed to the sorting functions by reference. Another void function named display must be used to display the sorted apvector elements in such a way that the sorted data can be viewed on the console window as 5 columns of 20 values each. A second apvector should be used to store the integers in their original order since the apvector that is passed by reference does not retain the original order. The menu must include the following options numbered 1 through 6 in this order: Selection Sort, Insertion Sort, Bubble Sort, Quick Sort, Merge Sort, and Quit. Your program must follow the Wyo Area Comp Sci Documentation & Coding Standards. Place a copy of Ch19Proj1.cpp in your Submit folder so that the instructor can execute your program within that folder.

    Preconditions:

    You must hand in the following on separate pages stapled in this specified order:

      1. The hardcopy source code for this assignment. Staple multiple pages together, if applicable.

Computer Science Using C++ Home Page | Mr. Minich's Wyo Home Page