Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Current Trends In Database Technology Edbt 2004 Workshops Edbt 2004 Workshops Phd Datax Pim P2panddb And Clustweb Heraklion Crete Greece March 2004 Revised Selected Papers Lncs 3268

Authors: Wolfgang Lindner ,Marco Mesiti ,Can Turker ,Yannis Tzitzikas ,Athena Vakali

2005th Edition

3540233059, 978-3540233053

More Books

Students also viewed these Databases questions

Question

Explain exothermic and endothermic reactions with examples

Answered: 1 week ago