Question: main.cpp / / #include #include #include QueueADT.h using namespace std; int main ( ) { / / Create the first queue ( strings )

main.cpp// #include
#include
#include "QueueADT.h"
using namespace std;
int main(){
// Create the first queue (strings)
// Write a loop to enter an unknown number of names, one per line.
// The loop stops when you enter #.
// As you are entering names, they are to be inserted into the first queue.
// Test the getLength function: - display the number of elements in the first queue
// Create the second queue (doubles)
// Test the getLength function: - display the number of elements in the second queue
//(it should be 0!)
// Write another loop to enter the number of units (double) into a parallel queue.
// Display the two queues in parallel.
// On the next line display the front and rear elements in the first queue.
// On the last line display the front and the rear elements in the second queue.
return 0;
}
QUEUEADT.h//
#ifndef QUEUE_ADT_H
#define QUEUE_ADT_H
template
class Queue
{
private:
// Structure for the stack nodes
struct QueueNode {
T value; // Value in the node
QueueNode *next; // Pointer to next node
};
QueueNode *front; // Pointer to the first node
QueueNode *rear; // Pointer to the last node
int length; // Number of nodes in the queue
public:
Queue(){ front = rear = NULL; length =0; }//Constructor
~Queue(); // Destructor
// Queue operations
/* Write your code here */
// isEmpty
// push
// pop
// peek
// peekRear
// getLength
};
/*
Member function push: inserts the argument into the queue
*/
/* Write your code here */
/*
Member function deletes the value at the front
of the queue and returns it.
Assume queue has at least one node
*/
/* Write your code here */
/*
Destructor
*/
/* Write your code here */
#endif
hi thank you for your help, please write the code according to the instructions in the given code.
main.cpp / / #include #include #include

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!