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

Microsoft Visual C#
7th Edition
ISBN:9781337102100
Author:Joyce, Farrell.
Publisher:Joyce, Farrell.
Chapter6: Using Arrays
Section: Chapter Questions
Problem 1CP: In previous chapters, you created applications for the Greenville Idol competition. Now, modify the...
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
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
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