Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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.
image text in transcribed

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Conceptual Database Design An Entity Relationship Approach

Authors: Carol Batini, Stefano Ceri, Shamkant B. Navathe

1st Edition

0805302441, 978-0805302448

More Books

Students also viewed these Databases questions