Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

***C++*** Expand on the given code to meet the following parameters: Code: #include #include using namespace std; struct QNode { string data; QNode* next; QNode(string

***C++***

Expand on the given code to meet the following parameters:

Code:

#include #include using namespace std; struct QNode { string data; QNode* next; QNode(string d) { data = d; next = NULL; } }; struct Queue { QNode *front, *rear; Queue() { front = rear = NULL; } void enQueue(string x) { // Create a new LL node QNode* temp = new QNode(x); // If queue is empty, then // new node is front and rear both if (rear == NULL) { front = rear = temp; return; } // Add the new node at // the end of queue and change rear rear->next = temp; rear = temp; } // Function to remove // a key from given queue q void deQueue() { // If queue is empty, return NULL. if (front == NULL) return; // Store previous front and // move front one node ahead QNode* temp = front; front = front->next; // If front becomes NULL, then // change rear also as NULL if (front == NULL) rear = NULL; delete (temp); } }; // Driven Program int main() { cout data data data data data data data data data data data data data data data data data data data data

Parameters:

image text in transcribed

1.- You program will collect the name of 10 students storing them in a linked list queue. 2.- Your program will display the name of the students ordered (FIFO) on the screen 3.- Your program will ask if the end-user wants to clean the queue (Y/N question). 3.1 - If the answer is yes, your program will dequeue all the nodes of the list and start asking for the names of the next batch of 10 students to process. 3.2 - If the answer is no then your program will exit

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions