Program to sort the data in the text file with Firstname, Lastname, GPA and Major using vector of type Student object.

The Assignment:

Create a class called Student. Student will have four instance variables: last name, first name, gpa, major. Implement constructors, accessor methods, mutator methods, and a print() method. The print() method prints out all of the information about an individual Student object in an easy to read format.

In the main application file, we will create a vector of Student objects.

Implement sorting methods that sort the array by last name, by gpa, and by major. It is up to you which sorting algorithm you would like to use. You can use the ones we've previously discussed. Pay careful attention to when and where you need value vs. reference parameters. Vectors ARE NOT automatically passed by reference!

Then, provide functionality to search for a particular student by last name.

The main program should be menu-based, it will provide the sorting options, the search by name option, and also an option to print all of the information.

You will fill the vector by way of file input.

Also, add functions in the main application file that allow the user to add a student to the list or remove a student from the list and update the menu appropriately.

Turn in Student.h, Student.cpp, StudentMain.cpp, students.txt
What is the question or problem?
How do I write a function for sorting the text files using vector of class student object? I want to sort the array by name, GPA and major. Different functions for each.
You don't have to sort the text file, but the vector of students.

How far have you got?
Topic archived. No new replies allowed.