Question Provided In The Attachment. USE C++ LANGUAGE. MATCH OUTPUT AS IT IS.   STRICTLY USE THE BELOW TEMPLATE WHEN MAKING A SOLUTION. ---------------------------------------------------------   main.cpp #include #include #include #include #include "Queue.cpp" using namespace std; int main() { //Fill your code

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Question Provided In The Attachment.

USE C++ LANGUAGE. MATCH OUTPUT AS IT IS.

 

STRICTLY USE THE BELOW TEMPLATE WHEN MAKING A SOLUTION.

---------------------------------------------------------

 

main.cpp

#include<cstring>
#include<iostream>
#include<queue>
#include<string>
#include "Queue.cpp"
using namespace std;
int main()
{
//Fill your code here
}

 

Queue.cpp

#include <bits/stdc++.h>
using namespace std;

class Queue
{
private:
int *q;

public:
int qsize = 5;
int r=-1;
int f=0;
Queue()
{
//Fill your code here
}

void enqueue(int item)
{
//Fill your code here
}

void dequeue()
{
//Fill your code here
}

void display()
{
//Fill your code here
}

};

Write a C++ program to simulate the working of queues using an array provide the following
operation:
i) Insert ii) Delete iii) Display
Assume that the size of the queue is 5.
Define the following functions in the class Queue
enqueue () --- to add value to queue
display () --- Display the values in list
dequeue () --- to delete the value from the queue
Note:
• While inserting the element to the queue if the Queue is full then print "Queue Overflow" in the
main method.
• While deleting the element from the queue if the Queue is empty then print "Queue Underflow" in
the dequeue () method.
• While displaying the elements from the queue if the Queue is empty then print "Queue is empty" in
the display() method.
Input and Output Format:
Refer sample input and output for formatting specifications.
[All text in bold corresponds to input and the rest corresponds to output]
Sample Input and Output 1:
1.Insert element to queue
2.Delete element from queue
3.Display all elements of queue
4.Quit
Enter your choice:
1
Enter the element to be inserted:
1.Insert element to queue
2.0
element from queue
3.Display all elements of queue
4.Quit
Enter your choice:
4
Sample Input and Output 2:
1.Insert element to queue
2.Delete element from queue
3.Display all elements of queue
4.Quit
Enter your choice:
1
Enter the element to be inserted:
13
1.Insert element to queue
2.Delete element from queue
3.Display all elements of queue
4.Quit
Enter your choice:
3
2
Element deleted from queue is: 17
1d----- -
1.Insert element to queue
2.Delete element from queue
3.Display all elements of queue
4.Quit
Enter your choice:
3
Queue is empty
1.Insert element to queue
2.Delete element from queue
3.Display all elements of queue
4.Quit
Enter your choice:
Queue Underflow
1.Insert element to queue
2.Delete element from queue
3.Display all elements of queue
4.Quit
Enter your choice:
4
Transcribed Image Text:Write a C++ program to simulate the working of queues using an array provide the following operation: i) Insert ii) Delete iii) Display Assume that the size of the queue is 5. Define the following functions in the class Queue enqueue () --- to add value to queue display () --- Display the values in list dequeue () --- to delete the value from the queue Note: • While inserting the element to the queue if the Queue is full then print "Queue Overflow" in the main method. • While deleting the element from the queue if the Queue is empty then print "Queue Underflow" in the dequeue () method. • While displaying the elements from the queue if the Queue is empty then print "Queue is empty" in the display() method. Input and Output Format: Refer sample input and output for formatting specifications. [All text in bold corresponds to input and the rest corresponds to output] Sample Input and Output 1: 1.Insert element to queue 2.Delete element from queue 3.Display all elements of queue 4.Quit Enter your choice: 1 Enter the element to be inserted: 1.Insert element to queue 2.0 element from queue 3.Display all elements of queue 4.Quit Enter your choice: 4 Sample Input and Output 2: 1.Insert element to queue 2.Delete element from queue 3.Display all elements of queue 4.Quit Enter your choice: 1 Enter the element to be inserted: 13 1.Insert element to queue 2.Delete element from queue 3.Display all elements of queue 4.Quit Enter your choice: 3 2 Element deleted from queue is: 17 1d----- - 1.Insert element to queue 2.Delete element from queue 3.Display all elements of queue 4.Quit Enter your choice: 3 Queue is empty 1.Insert element to queue 2.Delete element from queue 3.Display all elements of queue 4.Quit Enter your choice: Queue Underflow 1.Insert element to queue 2.Delete element from queue 3.Display all elements of queue 4.Quit Enter your choice: 4
Expert Solution
steps

Step by step

Solved in 2 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY