Objectives: Implement a program using the stack and queue operations. Description Write 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." Sample Output if Applicable Remarks Project name: TestStackQueue Filenames: stackqueue.h, stackqueue.c, main.c

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
(Don't use C++) Only use C
Objectives:
Implement a program using the stack and queue operations.
Description
Write 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."
Sample Output if Applicable
Remarks
Project name: TestStackQueue
Filenames: stackqueue.h, stackqueue.c, main.c
Transcribed Image Text:Objectives: Implement a program using the stack and queue operations. Description Write 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." Sample Output if Applicable Remarks Project name: TestStackQueue Filenames: stackqueue.h, stackqueue.c, main.c
Expert Solution
steps

Step by step

Solved in 3 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