new
and delete
operators.
.C
and .H
rather than .c
and .h
.
Date.H
as is, or if you
prefer, you may change the Date
structure to a class.
Student.H
, change the Student
structure to a class. Put all the data members in the private
section of the class. The public section should declare the following
member functions:
CreateStudent()
function)
DestroyStudent()
function)
GetIdNum()
:
// This function returns the value of // the private data member idNum long GetIdNum();
called Print()
(replaces the
PrintStudent()
function):
void Print (void);
Student.C
so that it contains the function
definitions for the member functions of the Student
class.
Be sure to:
new
and delete
instead of
malloc
and free
.
cout
rather than printf
.
ClassList.H
, change the StudentNode
and ClassList
structures to classes. The pointers
data
and next
should be private data members of the
StudentNode
class. The global variables head
,
tail
, and numStudents
should be private data
members of the ClassList
class.
StudentNode
class should
declare the following member functions:
CreateNode()
function)
DestroyNode()
function)
GetData()
:
// This function returns the value of // the private data member called "data" Student* GetData();
GetNext()
:
// This function returns the value of // the private data member called "next" StudentNode* GetNext();
SetNext()
:
// This function assigns a new value to // the private data member called "next". // The value to be assigned is passed in // as a parameter. void SetNext (StudentNode* nodePtr);
ClassList
class should
declare the following member functions:
InitializeList()
function)
ClassList.h
with some minor name changes:
EmptyList()
to Empty()
.
PrintList()
to Print()
.
DumpList()
to Dump()
.
ClassList.C
so that it contains the function
definitions for the member functions of the StudentNode
and ClassList
classes.
Be sure to:
new
and delete
instead of
malloc
and free
.
cout
rather than printf
.
GetData()
,
GetNext()
, and SetNext()
where
needed to access the private data members of the
StudentNode
class.
Proj2-test.C
.
Feel free to modify the main()
function as you see fit.
Insert()
, Find()
, and
Delete()
).
Student
class:
float gpa; // Student's Grade Point Average (GPA)
Student
class:
// This function returns the value of // the private data member gpa float GetGpa (void);
Student
constructor.
The additional parameter should be of type float
and should
be added to the end of the existing parameter list. Its purpose is to
pass in an intializing value for the private data member gpa
.
ClassList
class:
// This function returns the sum of the // GPA's for all of the students currently // stored in the list. float GetGpaSum (void);
Proj2.C
.
Do not make any changes to this file other than adding comments or
moving curly braces.
.H
files has a function comment.
Proj2
.
You may also submit additional files if you created any auxilliary source files. Do NOT submit your executable, object files, test data files, etc.