Question: C++ Template class sort from txt data Create a text file called classes.txt . This text file lists, by course number and section number. 10

C++ Template class sort from txt data

Create a text file called classes.txt. This text file lists, by course number and section number. 10

The contents of the file could state: 801 7045 801 1206 801 3450 802 1688 802 3285 808 3278 (and so on)

Note that the courses are listed by course number. You can also list them in random order. However, do not list them by section number. That is what your program will do.

How the Program Works

The program first displays a menu prompting the user to choose one of the six sort methods covered in Section 10.1 of the book, or exit (you can assume the user will choose a valid menu choice):

A.Selection

B.Bubble

C.Insertion

D.Heap

E.Quick

F.Merge

G.Exit

If the user chooses Exit, the program ends. Otherwise, the program loads the classes.txt text file which you created.

The program then sorts and displays the courses in ascending order of section number using the method chosen by the user. Just an example of a display: 1121 839 1321 802 3112 870 3278 808 3285 802 3450 801 7045 801

The program re-displays the menu in step #1.

Files

In addition to your driver file, put each of the 6 sort methods in a separate file or files. For example, for merge sort, you can have 1 .cpp file, or split that code into an .h and a .cpp file. Therefore, you'll have at least 7 code files, and possibly as many as 13. You also will have your classes.txt text file.

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!