Jason
2012-06-25 17:05:23 UTC
Ok, I need to figure out how to make and use the functors(function objects) , make and use a sort function for each data entry held in a record, (8 different pieces of data), and also get my code working again. Here are the specific requirements(again):
Given a file containing student information records in the following format (one record a line):
Last_name, first_name initial; class; major; minor; total credit hours; GPA; academic standing
For example:
Williams, John D.; Junior; IT; Math; 118; 3.29; Good
Doe, Jane K.; Freshman; Sociology; None; 75; 2.8; Average
…..
Requirements:
1. Design and implement a class to represent the student record with function objects for comparing last name, first name, total credit hours, and GPA.
2. Implement a menu-based application that with the following features:
Main menu:
i. Show Records
ii. Sort Records
iii. Exit
Your program will load all the records from a file, named “student.records”, into a vector when it is launched, and then show the main menu.
Show Records: when selected will show the first five records, and allows user to choose either “next five”, “previous five” or “Main Menu” and react to the user’s input accordingly.
Sort Records: allows the user to choose one of the following fields to sort: last name, first name, total credit hours, and GPA. Your program will sort the vector of record based on the user’s selected option and proceed to “Show record”, i.e. show 5 records at a time. – You can consult the template bubble sort function in chapter 3.
Exit: terminate the program
My current code is missing the sort function and I think the function objects(don't know if I have them without realizing it). I had the output working properly, but had to make changes because it was outputting the same thing no matter what input, and was always repeating the main menu output prompt. However, now when it runs, it doesn't do anything, it just has a cursor in cmd prompt. So here is my code now, please tell me exactly what I need to do to get it working without any problems, and what I need to do to meet the requirements: http://pastebin.com/YtgXKb6c Remember comments and explanations, and specifics.