Question: For this assignment you will implement stacks and queues ADT. A stack and a queue are the same if they have the same number of

For this assignment you will implement stacks and queues ADT. A stack and a queue are the same if they have the same number of elements and the elements at the corresponding positions are the same. The program displays a menu on the screen allowing the user to enter the elements of stack and queue. The program terminates when the user enters 9.

MUST FOLLOW THESE INSTRUCTIONS: You are not allowed to use stack / queue libraries. You must implement all stack / queue functions and operations . Must use templates to implement this program.

MUST BE DONE IN C++

VALIDATIONS:

The program accepts only integer data type when selecting from the menu (1 or 9).

Everything else should be rejected with an invalid option message.

SAMPLE RUN OF HOW THE PROGRAM SHOULD LOOK LIKE:

*** Welcome to my stack - queue program *** The function of this program is to validate that a stack and a queue are identical. Stacks/queues are same if they have the same number of elements and their elements at the corresponding positions are the same. Select from the following menu 1. Enter stack/queue values. 9. Terminate the program. Enter your choice from the menu ----> abc ** Invalid choice ** Enter your choice from the menu ----> 5 ** Invalid choice ** Enter your choice from the menu ----> 123 ** Invalid choice ** Enter your choice from the menu ----> ; ** Invalid choice ** Enter your choice from the menu ----> 1

Enter stack values terminated by ; 123; Enter queue values terminated by ; 123; Stack and Queue are identical Select from the following menu 1. Enter stack/queue values. 9. Terminate the program. Enter your choice from the menu ----> 1 Enter stack values terminated by ; 123; Enter queue values terminated by ; 132; Stack and Queue are not identical Select from the following menu 1. Enter stack/queue values. 9. Terminate the program. Enter your choice from the menu ----> 1 Enter stack values terminated by ; abc; Enter queue values terminated by ; ABC; Stack and Queue are not identical Select from the following menu 1. Enter stack/queue values. 9. Terminate the program. Enter your choice from the menu ----> 1 Enter stack values terminated by ; 12345; Enter queue values terminated by ; abcdefghijklmnOP; Stack and Queue are not identical

Select from the following menu 1. Enter stack/queue values. 9. Terminate the program. Enter your choice from the menu ----> x ** Invalid choice ** Enter your choice from the menu ----> 9 *** Program is terminated. ***

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!