Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Create QueueItem.cpp by implementing QueueItem.h QueueItem.h: class QueueItem { public: QueueItem ( char * pData, int id ) ; / / ctor void setNext (
Create QueueItem.cpp by implementing QueueItem.h
QueueItem.h:
class QueueItem
public:
QueueItemchar pData, int id; ctor
void setNextQueueItem pItem;
QueueItem getNext const;
int getId const;
const char getData const;
private:
char data;
const int itemId; unique id for item in queue
QueueItempNext; next item in queue
; end definition class QueueItem
Create Queue.cpp by implementing Queue.h
Queue.h:
#include
#include "QueueItem.h
class Queue
public:
Queue; ctor inits a new empty Queue
~Queue; dtor erases any remaining QueueItems
void addItemchar pData;
void removeItem;
void print;
void erase;
private:
QueueItempHead; always points to first QueueItem in the list
QueueItempTail; always points to last QueueItem in the list
int itemCounter; always increasing for a unique id to assign to each new QueueItem
; end definitionclass Queue
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started