Input Values Expected Output Operation to Be Tested and Description of Action Create a queue of integers of size 5 Print if the queue is empty or not Call the Front function Enqueue four items Print if the queue is empty or not Check if the queue is full Enqueue another item Print the values in the queue |Print if the queue is full or not Enqueue another item Dequeue two items Print the values in the queue Dequeue three items Print if the queue is empty or not Dequeue an item Enqueue five items |Queue is Empty No data to return 5742 Queue is not Empty Queue is not Full 6 5 7 4 2 6 Queue is Full 8. Queue is already Full 426 Queue is Empty Queue is already Empty 12345

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

This is a c++ programming question so do exactly what the question says and follow the pattern in the image that I gave just follow the pattern and implement all the functions as single linked list

Question - (Implement all the functions as like singly linked list)

See the picture

Input Values Expected Output
Operation to Be Tested and Description of Action
Create a queue of integers of size 5
Print if the queue is empty or not
Call the Front function
Enqueue four items
Print if the queue is empty or not
Check if the queue is full
Enqueue another item
Print the values in the queue
Print if the queue is full or not
Enqueue another item
Dequeue two items
Print the values in the queue
Dequeue three items
Print if the queue is empty or not
Dequeue an item
Enqueue five items
Create a new function so that you can print the Queue in
reverse order.
Queue is Empty
No data to retun
5742
Queue is not Empty
Queue is not Full
574 26
Queue is Full
8
Queue is already Full
426
Queue is Empty
Queue is already Empty
12345
5 4 3 2 1
void PrintReverse(QueType<int> q);
However, The actual Queue has to remain identical.
Print the values in the queue
Suppose, There is a queue in front of our NSU lift and the
lift's weight limit meter isn't working today.
You have the weight count all of the members in front of
that lift. As a programmer, write a function so that you can
calculate the total weight and tell the people weather all
the members can get into the lift
1 23 4 5
Good to go
45 55 65
75 80
350
65 75 70
Over Weight.
80 100
Maximum Limit 350.
bool WeightMeter(QueType<int> q, int weightLimit);
350
Let's consider, there are max_items members in front of
the lift.
(*Here 350 will be based
on user input of weight
limit).
Take an integer n from the user as input and use a queue
to print Binary values of each integer from 1 to n. Here is
how it can be done.
o Create an empty queue
o Enqueue the first binary number “1" to the queue.
o Now run a loop for generating and printing n binary
numbers.
• Dequeue and print the value.
· Append "0" at the dequeued value and enqueue it.
• Append “1" at the dequeued value and enqueue it.
10
1
10
11
100
101
110
111
1000
1001
1010
void PrintBinary(int n);
*(You might have to change the max_items of the
Queue for this function).
Transcribed Image Text:Input Values Expected Output Operation to Be Tested and Description of Action Create a queue of integers of size 5 Print if the queue is empty or not Call the Front function Enqueue four items Print if the queue is empty or not Check if the queue is full Enqueue another item Print the values in the queue Print if the queue is full or not Enqueue another item Dequeue two items Print the values in the queue Dequeue three items Print if the queue is empty or not Dequeue an item Enqueue five items Create a new function so that you can print the Queue in reverse order. Queue is Empty No data to retun 5742 Queue is not Empty Queue is not Full 574 26 Queue is Full 8 Queue is already Full 426 Queue is Empty Queue is already Empty 12345 5 4 3 2 1 void PrintReverse(QueType<int> q); However, The actual Queue has to remain identical. Print the values in the queue Suppose, There is a queue in front of our NSU lift and the lift's weight limit meter isn't working today. You have the weight count all of the members in front of that lift. As a programmer, write a function so that you can calculate the total weight and tell the people weather all the members can get into the lift 1 23 4 5 Good to go 45 55 65 75 80 350 65 75 70 Over Weight. 80 100 Maximum Limit 350. bool WeightMeter(QueType<int> q, int weightLimit); 350 Let's consider, there are max_items members in front of the lift. (*Here 350 will be based on user input of weight limit). Take an integer n from the user as input and use a queue to print Binary values of each integer from 1 to n. Here is how it can be done. o Create an empty queue o Enqueue the first binary number “1" to the queue. o Now run a loop for generating and printing n binary numbers. • Dequeue and print the value. · Append "0" at the dequeued value and enqueue it. • Append “1" at the dequeued value and enqueue it. 10 1 10 11 100 101 110 111 1000 1001 1010 void PrintBinary(int n); *(You might have to change the max_items of the Queue for this function).
Queue (array based)
In today's lab we will design and implement the Queue ADT using array.
quetype.h
#ifndef QUETYPE_H_INCLUDED
#define QUETYPE_H_INCLUDED
const int max_items = 50;
class FullQueue {
class EmptyQueue {
template<class T>
class QueType
|{
public:
QueType();
void MakeEmpty();
bool isEmpty();
bool isFull();
void Enqueue(T);
void Dequeue();
T Front();
private:
int front;
int rear;
Tinfo(max_items];
#endif // QUETYPE_H_INCLUDED
Transcribed Image Text:Queue (array based) In today's lab we will design and implement the Queue ADT using array. quetype.h #ifndef QUETYPE_H_INCLUDED #define QUETYPE_H_INCLUDED const int max_items = 50; class FullQueue { class EmptyQueue { template<class T> class QueType |{ public: QueType(); void MakeEmpty(); bool isEmpty(); bool isFull(); void Enqueue(T); void Dequeue(); T Front(); private: int front; int rear; Tinfo(max_items]; #endif // QUETYPE_H_INCLUDED
Expert Solution
steps

Step by step

Solved in 2 steps with 1 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