Question: Write a C + + program that will simulate ADT stack / queue using a linked List ADT with actual pointers. The program will perform

Write a C++ program that will simulate ADT stack / queue using
a linked List ADT with actual pointers. The program will
perform the following operation in the following sequence:
A. Build a stack that consist of 8 random integer numbers
that are 65 and 98
B. Build a queue that consist of 8 random integer numbers
that are 189 and 289
C. Insert the element -20 in the stack ( LIFO).
D. Remove the top two elements from the stack ( LIFO).
E. Insert element -500 in the queue (FIFO).
F. Insert element -200 in the 3rd location of the queue.
G. Remove the first element from the queue ( FIFO).
H. Remove the 4th element from the queue.
I. Find Min and the Max elements in the queue.
J. Delete the entire stack.
K. Remove the first element from the stack. An error
message should be displayed if the stack is empty.
L. Delete the entire queue.
M.Remove the last element from the queue. An error
message should be displayed if the queue is empty.
Repeat the process or enter x to exit the program.
The entire list must be displayed After completion of each step
starting from A thru I,K, and M. The program must continue
running until the letter x is entered.
Notes :
Validation must be done on the character that you enter to
repeat the process. Only capital letters are accepted to
terminate the program. Everything else should re-run the
program again.
Must use at least 13 functions to handle the operations (A-
M )
Must place a header / signature line at the beginning and
before terminating the program ( Look at the sample run )
You are not allowed to use any types of arrays, any type of global
arrays. You are also not allowed to use global variables.
 Write a C++ program that will simulate ADT stack / queue

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!