Question: Use the implemented stack on the Lab manual ( using array ) to write a complete C + + program that contain the following: A
Use the implemented stack on the Lab manual using array to write a complete
C program that contain the following:
A function to fill up stack with randomly characters from az and AZ onlypts
A function to split this stack into two separated stacks; the first stack must only
contain the uppercase characters and the second stack must only contain the
lowercase characters. pts
main function to test the previous two functions and display the content of the
three stacks. pt
Sample output:
Input stack : a A u P j e N I N
First stack : A P N I N
Second stack: a u e
Notes:
Dont use #include or any other external libraries to solve the question
you can only use #include using name space std or
#include
The output must be exactly as mentioned.
mplemented stack on the Lab manual using array :
template
class Stack int topindex;
T entryMAX; Maximum size of Stack
public:
Stack topindex ;
bool PushT x
if topindex MAX
return false;
entrytopindex x;
return true;
bool Pop
if topindex
return ;
topindex;
return ;
bool TopT &x
if topindex
return ;
x entrytopindex;
return ;
bool Empty
return topindex ;
;
template
void printStack s
T item;
while sEmpty
sTopitem;
cout
void fillStack &s int n
for int i;in;i
sPushrand;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
