hi,
This is only my interpretation, I would recommend get clarification from your teacher.
Modify the Link class from 17.10.1 to hold a value of a class God |
So the
Link
class needs to have a member variable added, which is of type
class God
.
That implies you have to create your own
God
class with these as member variables:
Class God should have members of type string: name, mythology, vehicle, weapon. |
Write a print_all() function that lists gods with their attributes one per line. Add a member function add_ordered() that places its new element in its current lexicographical position. Using the Links with the values of type God, make a list of god from three lexicographically ordered lists - one per each mythology. |
So a Link is one item in a linked list - the goal is to make an actual linked list container object?
This class will have the functions
print_all()
and
add_ordered()
. The
print_all()
function implies that the God class should have it's own
PrintDetails()
function.
Now make 3 objects of this container class, 1 for each mythology.
Make yet another list object which represents all the gods, use the 3 lists (of each mythology) to populate it.
That last part is a bit confusing, I would naturally have a list of all the gods first, then split that up into the 3 mythology types.
Good Luck !! :+)