Simple C programming (4)

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 queueback – 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).
driver.txt

Unformatted Attachment Preview

Don't use plagiarized sources. Get Your Custom Essay on
Simple C programming (4)
Just from $13/Page
Order Essay

#include “MyQueue.h”
#include
using namespace std;
int main()
{
int x, y;
MyQueue m;
m.enqueue(8);
m.enqueue(6);
m.enqueue(7);
m.enqueue(5);
m.enqueue(3);
m.first(x);
m.last(y);
cout << x << ", " << y << endl; m.dequeue(); m.dequeue(); m.first(x); cout << x << endl; while(!m.isEmpty()) m.dequeue(); } ... Purchase answer to see full attachment

Order a unique copy of this paper
(550 words)

Approximate price: $22

Basic features
  • Free title page and bibliography
  • Unlimited revisions
  • Plagiarism-free guarantee
  • Money-back guarantee
  • 24/7 support
On-demand options
  • Writer’s samples
  • Part-by-part delivery
  • Overnight delivery
  • Copies of used sources
  • Expert Proofreading
Paper format
  • 275 words per page
  • 12 pt Arial/Times New Roman
  • Double line spacing
  • Any citation style (APA, MLA, Chicago/Turabian, Harvard)

Our guarantees

Delivering a high-quality product at a reasonable price is not enough anymore.
That’s why we have developed 5 beneficial guarantees that will make your experience with our service enjoyable, easy, and safe.

Money-back guarantee

You have to be 100% sure of the quality of your product to give a money-back guarantee. This describes us perfectly. Make sure that this guarantee is totally transparent.

Read more

Zero-plagiarism guarantee

Each paper is composed from scratch, according to your instructions. It is then checked by our plagiarism-detection software. There is no gap where plagiarism could squeeze in.

Read more

Free-revision policy

Thanks to our free revisions, there is no way for you to be unsatisfied. We will work on your paper until you are completely happy with the result.

Read more

Privacy policy

Your email is safe, as we store it according to international data protection rules. Your bank details are secure, as we use only reliable payment systems.

Read more

Fair-cooperation guarantee

By sending us your money, you buy the service we provide. Check out our terms and conditions if you prefer business talks to be laid out in official language.

Read more

Calculate the price of your order

550 words
We'll send you the first draft for approval by September 11, 2018 at 10:52 AM
Total price:
$26
The price is based on these factors:
Academic level
Number of pages
Urgency

Order your essay today and save 15% with the discount code ESSAYHELP