1. Create a class named waitList that can store a name and number of guests. Use constructors to automatically initialize the member variables.
2. Add the following operations to your program:
a. Return the first person in the queue
b. Return the last person in the queue
c. Add a person to the queue
d. Delete a person from the queue
3. Create a main program to test your class. Your main program should contain the following options.
a. Add a guest (adds the reservation name and number of guests)
b.Delete a guest (the user must give you the name to delete, the list may be empty or the guest may not be in the list)
c. Show last guest waiting (return NONE if the queue is empty)
d. Show first guest waiting (return NONE if the queue is empty)
This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.// queue.cpp : Defines the entry point for the console application.
using namespace std;
waitList(string n, int nog):name(n), numberOfGuests(nog)
next = NULL;
bool SearchwaitList(waitList* head, string name) // Returns boolean as it is used to check if the new contact alreadz exist
int i = 1;
reservation = head;
while ((reservation != NULL) && (reservation->name != name))
reservation = reservation->next;
return (reservation != NULL);