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
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 ;
QUEUEADT.h
#ifndef QUEUEADTH
#define QUEUEADTH
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 ; 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.
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
