Using the following UML diagram and class description, write a class named MyQueue which implements a pointer-based Queue.

Class Attributes:

Node is a private nested struct. It’s members are:

i – stores an integer value.
next – stores the memory address of the next node in the queue.

front – The front node. Stores the memory address of the first node in the queue
back – The last node. Stores the memory address of the last node in the queue.
Constructor – initializes front and back to null.
Destructor – frees all memory used by the queue.
isEmpty – returns true if the queue is empty, false otherwise.
isFull – returns true if there isn’t enough memory for a new node, false otherwise.
enqueue – accepts an integer as it’s only argument. The value is added to the end of the queue. Returns 0 if successful, -1 otherwise. Can’t enqueue if you can’t make a new node.
dequeue – removes the first node from the queue, freeing the it’s memory. Returns 0 if successful, -1 otherwise. Can’t dequeue from an empty list.
first – stores the first value in the queue to it’s reference parameter, if the queue isn’t empty. Returns 0 if successful, -1 otherwise. Will fail if the queue is empty.
last – stores the last value in the queue to it’s reference parameter, if the queue isn’t empty. Returns 0 if successful, -1 otherwise. Will fail if the queue is empty.

Notes:

The class does not interact with the user in any way, so no cin or cout statements.
All accessors should be marked const.
struct Node is nested in the class and is private.

Hints:

Save yourself from writing duplicate code by having the class destructor repeatedly call the dequeue method.
You can use this driver (see file upload) to get you started on testing.

Submission Details:

Place your class in it’s own header file named MyQueue.h.
Submit only this file.
Be sure to include preprocess guards( #ifndef, #define, #endif).

 
Do you need a similar assignment done for you from scratch? We have qualified writers to help you. We assure you an A+ quality paper that is free from plagiarism. Order now for an Amazing Discount! Use Discount Code “Newclient” for a 15% Discount!NB: We do not resell papers. Upon ordering, we do an original paper exclusively for you.

The post simple-c-programming-4 appeared first on Essay Fount.


What Students Are Saying About Us

.......... Customer ID: 12*** | Rating: ⭐⭐⭐⭐⭐
"Honestly, I was afraid to send my paper to you, but you proved you are a trustworthy service. My essay was done in less than a day, and I received a brilliant piece. I didn’t even believe it was my essay at first 🙂 Great job, thank you!"

.......... Customer ID: 11***| Rating: ⭐⭐⭐⭐⭐
"This company is the best there is. They saved me so many times, I cannot even keep count. Now I recommend it to all my friends, and none of them have complained about it. The writers here are excellent."


"Order a custom Paper on Similar Assignment at essayfount.com! No Plagiarism! Enjoy 20% Discount!"