C++ expert to help me work this one out. Here it is below.
implement an abstract data
type (ADT) Student as a C++ class. The project
involves writing a program
that searches for duplicates in two files with lists
of student records. The
input files must be given sorted by student name.
I. The class has to be named Student and its
definition has to be in a file
named student.h.
The class has to store the components of the student
record in private
member data fields. The components should include
first name, last name, an
integer number of credits completed, and a floating
point grade point
average.
The class has to contain the following functions:
A function input() that reads in a student record
from a file. All the data
fields will be separated by at least one space. The
order of the fields is
first name, last name, credits, and grade point.
A function output() that writes out a student record
to the screen. The
function should output last name and first name
separated with a comma (note
that the last name has to be output first.)
A function lessThan() that compares two students.
Only the names are
compared. The last name is more significant than the
first one.
A function equals() that compares two students. Only
the names are compared
as with the lessThan() function.
The bodies of the above functions should be in a
file called student.cpp.
II. The program has to search for duplicates in two
files that contain lists
of student records. The input files must be in
sorted order by student name.
This program should contain two independent
functions described below:
The main() function, which calls the checkSorted()
function twice to verify
that each of the input files is sorted in strictly
ascending order. It then
performs the search operation. When a duplicate is
found the student record
from both files should be displayed, because
although the names will match
the other fields may be different. The output is to
be displayed on the
screen.
A function called checkSorted(), which accepts the
input stream as a parameter. This function should prompt the user for
the name of the input file. If the file cannot be opened, it should
continue to reprompt the user for the correct name, until the file can be opened.
The file should be read and it should verify that the file is in ascending
order. If it is not, an appropriate error message should be displayed and
the program should terminate. Otherwise, after the file has been
completely read, it should be closed and reopened to position it at the beginning of the file.