Course Solutions Uncategorized (Solved) : Fix Errors Pls Trying Write Queue Using Array Struct Given Hpp Ifndef Hw4todoqueuearray De Q31763742 . . . .

(Solved) : Fix Errors Pls Trying Write Queue Using Array Struct Given Hpp Ifndef Hw4todoqueuearray De Q31763742 . . . .

 

Fix the errors pls;

I was trying to write a queue using array and struct.

this is the given hpp;

#ifndef HW4_TODO_QUEUEARRAY

#define HW4_TODO_QUEUEARRAY

#include <string>

struct TodoItem

{

std::string todo;

};

const int MAX_QUEUE_SIZE = 5;

class TodoQueueArray

{

public:

TodoQueueArray();

bool isEmpty();

bool isFull();

void enqueue(std::string todoItem);

void dequeue();

TodoItem* peek();

int getQueueFront() { return queueFront; }

int getQueueEnd() { return queueEnd; }

TodoItem** getQueue() { return queue; }

private:

int queueFront; //the index in queue[] that will be dequeuednext

int queueEnd; //the index in queue[] that was most recentlyenqueued

TodoItem* queue[MAX_QUEUE_SIZE];

};

#endif

this is my code for cpp:

#include <iostream>

#include “HW4-Todo-QueueArray.hpp”

using namespace std;

TodoQueueArray::TodoQueueArray()

{

queueFront=-1;

queueEnd=-1;

}

bool TodoQueueArray::isEmpty()

{

if(queueFront == -1 && queueEnd == -1)

{

return true;

}

else

{

return false;

}

}

bool TodoQueueArray::isFull()

{

if(queueEnd==MAX_QUEUE_SIZE-1)

{

return true;

}

else

{

return false;

}

}

void TodoQueueArray::enqueue(std::string todoItem)

{

if(isFull())

{

cout << “Queue full, cannot add new todo item.”<<endl;

}

else

{

queueEnd++;

struct TodoItem*

OR

PayPal Gateway not configured

OR

PayPal Gateway not configured

Leave a Reply

Your email address will not be published. Required fields are marked *

Related Post

Assignment Interview Questions Potential Legal Trouble Due Sunday January 13th 11 55 Pm Po Q34200384Assignment Interview Questions Potential Legal Trouble Due Sunday January 13th 11 55 Pm Po Q34200384

<br/><img src="https://media.cheggcdn.com/media%2Faff%2Faffff4aa-b57f-40df-b14c-df1efd934245%2Fimage.png" alt="Assignment: Interview Questions Potential Legal Trouble? DUE: Sunday, January 13th, 11:55 p.m. Point Value: 25 pts Directions: The follow table gives you a chance to decide if certain