Code in C, Implement a C program using the stack and queue operations Code a stack and queue test driver. A test driver is a program created to test functions that are  to be placed in a library. Its primary purpose is to completely test functions; therefore, it has no  application use. The functions to be tested are push stack, pop stack, enqueue, and dequeue.  You may include other stack and queue functions as required. All data should be integers. You  need two stacks and two queues in the program, as described below. a. Input stack: used to store all user input b. Input queue: used to store all user input c. Output stack: used to store data deleted from input queue d. Output queue: used to store data deleted from input stack Use a menu-driven user interface that prompts the user to select either insert or delete. If an  insert is requested, the system should prompt the user for the integer to be inserted. The data  are then inserted into the input stack and input queue. If a delete is requested, the data are  deleted from both structures: the data popped from the input stack are enqueued in the output  queue, and the data dequeued from the input queue are pushed into the output stack. Processing continues until the input structures are empty. At this point print the contents of the  output stack while deleting all of its data. Label this output "Output Stack", then print all of the  data in the output queue while deleting all of its data. Label this output "Output Queue."

C++ Programming: From Problem Analysis to Program Design
8th Edition
ISBN:9781337102087
Author:D. S. Malik
Publisher:D. S. Malik
Chapter18: Stacks And Queues
Section: Chapter Questions
Problem 1TF
icon
Related questions
Question

Code in C, Implement a C program using the stack and queue operations

Code a stack and queue test driver. A test driver is a program created to test functions that are 
to be placed in a library. Its primary purpose is to completely test functions; therefore, it has no 
application use. The functions to be tested are push stack, pop stack, enqueue, and dequeue. 
You may include other stack and queue functions as required. All data should be integers. You 
need two stacks and two queues in the program, as described below.

a. Input stack: used to store all user input
b. Input queue: used to store all user input
c. Output stack: used to store data deleted from input queue
d. Output queue: used to store data deleted from input stack


Use a menu-driven user interface that prompts the user to select either insert or delete. If an 
insert is requested, the system should prompt the user for the integer to be inserted. The data 
are then inserted into the input stack and input queue. If a delete is requested, the data are 
deleted from both structures: the data popped from the input stack are enqueued in the output 
queue, and the data dequeued from the input queue are pushed into the output stack.

Processing continues until the input structures are empty. At this point print the contents of the 
output stack while deleting all of its data. Label this output "Output Stack", then print all of the 
data in the output queue while deleting all of its data. Label this output "Output Queue."

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 5 steps

Blurred answer
Knowledge Booster
Stack
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
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
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning