Answered step by step
Verified Expert Solution
Link Copied!

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:
QueueItem(char* pData, int id); // ctor
void setNext(QueueItem* pItem);
QueueItem* getNext() const;
int getId() const;
const char* getData() const;
private:
char _data[30];
const int _itemId; // unique id for item in queue
QueueItem*_pNext; // 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 addItem(char* pData);
void removeItem();
void print();
void erase();
private:
QueueItem*_pHead; // always points to first QueueItem in the list
QueueItem*_pTail; // 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

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

Step: 3

blur-text-image

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

More Books

Students also viewed these Databases questions

Question

Define an analog and a digital signal.

Answered: 1 week ago

Question

LO3 Define job design and identify common approaches to job design.

Answered: 1 week ago