I need to use an array of 5 elements. Each element of the array is a structure with 2 fields: the name of the hotel and a singly linked list of attendees staying in that hotel.
Functions are:
CheckIn
CheckOut
Transfer
Count
Print
Quit
If someone could just show me how the classes are supposed to be built and how one function would be implemented, I can do the rest. I just can't figure out how it is supposed to be implement with the extra array element structure in the middle.
This is what I have so far
#ifndef DOUBLY_LINKED_LIST
#define DOUBLY_LINKED_LIST
enum IntHotel {
Hershey,
Milton,
Sheraton,
BestWestern,
DaysInn
};
class SLLNode {
public:
//pointer to next node
SLLNode *next;
//array to hold customer name
char name[50];
//constructor
SLLNode(char n[], SLLNode *p = 0) {
next = p; name = n
}
};
class ArrayStruct {
char hotelName [13];
SLLNode *attendee;
};
class SLList {
public:
//constructor
SLList() {
head = tail = 0;
}
//destructor
~SLList();
//actions
void CheckIn();
char* CheckOut();
void transfer();
int count();
void print();
void quit();
private:
SLLStruct *head[5], *tail[5];
};
#endif
Much Thanks