MATCH OUTPUT AS IT IS . FOLLOW QUESTION ----------------------------------------- Dr. Varun needs an application for his clinic to maintain all the appointments for the day. The application should make appointments on the basis of first come first serve basis. And it should also perform the following functions: insert new appointment, delete an appointment, display all the appointments, show next appointment, check if there is no appointment or number of appointments are full for a day.  Use class templates to perform the above-mentioned operations. Write a C++ program to perform the Queue operation. Note: Use the following class template for Queue creation. template  class Queue {    private:          int front,rear;          T *queue;           int maxsize; }; Define the following function in the class Queue class Method name Description int isFull() The method is used to check whether the queue is full or not. void insert(T) The method is used to display the rear element in the queue (if the queue is stored with the element(s)). void deletion() The method is used to delete the front element from the queue. void atFront() The method is used to display the front element in the queue (if the queue is stored with the element(s)). void atRear() The method is used to add data to the rear end of the queue. void display() The method is used to display all the data in the queue. int isEmpty() The method is used to check whether the queue is empty or not.   Input and Output Format: The first line of input corresponds to the size of the array. Refer sample input and output for formatting specifications. Sample Input and Output : [All text in bold corresponds to input and the rest corresponds to output] Enter the array size 3 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:1 Enter the element to insert : 1 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:1 Enter the element to insert : 2 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:1 Enter the element to insert : 3 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:1 Enter the element to insert : 4 Queue is full! 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:5 Queue elements are :  1 2 3 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:3 Front element of the queue is : 1 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:4 Rear element of the queue is : 3 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:2 Deleted element of the queue is : 1 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:5 Queue elements are :  2 3 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:3 Front element of the queue is : 2 1.Insertion 2.Deletion 3.Display Front Element 4.Display Rear Element 5.Display Queue 6.Exit Enter your Choice:6

Programming with Microsoft Visual Basic 2017
8th Edition
ISBN:9781337102124
Author:Diane Zak
Publisher:Diane Zak
Chapter6: Sub And Function Procedures
Section: Chapter Questions
Problem 5E
icon
Related questions
Question

MATCH OUTPUT AS IT IS . FOLLOW QUESTION

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

Dr. Varun needs an application for his clinic to maintain all the appointments for the day. The application should make appointments on the basis of first come first serve basis. And it should also perform the following functions: insert new appointment, delete an appointment, display all the appointments, show next appointment, check if there is no appointment or number of appointments are full for a day.  Use class templates to perform the above-mentioned operations.

Write a C++ program to perform the Queue operation.

Note:
Use the following class template for Queue creation.

template <class T>
class Queue
{
   private:
         int front,rear;
         T *queue;
          int maxsize;
};

Define the following function in the class Queue class

Method name Description
int isFull() The method is used to check whether the queue is full or not.
void insert(T) The method is used to display the rear element in the queue (if the queue is stored with the element(s)).
void deletion() The method is used to delete the front element from the queue.
void atFront() The method is used to display the front element in the queue (if the queue is stored with the element(s)).
void atRear() The method is used to add data to the rear end of the queue.
void display() The method is used to display all the data in the queue.
int isEmpty() The method is used to check whether the queue is empty or not.
 
Input and Output Format:
The first line of input corresponds to the size of the array.
Refer sample input and output for formatting specifications.

Sample Input and Output :
[All text in bold corresponds to input and the rest corresponds to output]

Enter the array size
3
1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:1

Enter the element to insert : 1

1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:1

Enter the element to insert : 2

1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:1

Enter the element to insert : 3

1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:1

Enter the element to insert : 4

Queue is full!
1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:5

Queue elements are :  1 2 3
1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:3

Front element of the queue is : 1
1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:4

Rear element of the queue is : 3
1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:2

Deleted element of the queue is : 1
1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:5

Queue elements are :  2 3
1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:3

Front element of the queue is : 2
1.Insertion
2.Deletion
3.Display Front Element
4.Display Rear Element
5.Display Queue
6.Exit
Enter your Choice:6

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
COMPREHENSIVE MICROSOFT OFFICE 365 EXCE
Computer Science
ISBN:
9780357392676
Author:
FREUND, Steven
Publisher:
CENGAGE L
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
LINUX+ AND LPIC-1 GDE.TO LINUX CERTIF.
Computer Science
ISBN:
9781337569798
Author:
ECKERT
Publisher:
CENGAGE L
C++ Programming: From Problem Analysis to Program…
C++ Programming: From Problem Analysis to Program…
Computer Science
ISBN:
9781337102087
Author:
D. S. Malik
Publisher:
Cengage Learning