Question: LAB 4: STACK IMPLEMENTATION 1. Given the codes for stack_01.cpp and do the following tasks. a) Complete the code for pop() function so that it

 LAB 4: STACK IMPLEMENTATION 1. Given the codes for stack_01.cpp anddo the following tasks. a) Complete the code for pop() function so

LAB 4: STACK IMPLEMENTATION 1. Given the codes for stack_01.cpp and do the following tasks. a) Complete the code for pop() function so that it will return the popped item, (char), if the stack not empty and return an asterisk *** if the stack is empty. b) Complete the code for printPop (char) function so that: i) it will print the popped item (char) if the parameter not equal to *** "Popped item: ?" ii) and print Pop operation fail - stack is empty!" if the parameter equal to The output must be exactly as below: Push operation success! item: a Push operation success! item: b Push operation success! item: C Popped iten: c Popped iten: b Popped iten: a Pop operation fail - stack is empty! 2 Given the codes for stack_02.cpp" and do the following tasks. a) Complete the code for printLIFO() function so that it will print all the stack item using LIFO and you must not using popO function to do it. b) Complete the code for printFIFO() function so that it will print all the stack item using FIFO and you must not using pop() function to do it. c) The output must be exactly as follow: Push operation success item: a Push operation success iten: b Push operation successt iten: c FIFO printing abo LIFO printing cba 3 Given the codes for stack_03.cpp" and do the following tasks. Complete the code for emptyStack() function, which will remove all items in the stack using the pop() function. The output must be exactly as below: Push operation success! iten: d Push operation success! iten: e Push operation success! item: S Push operation success! iten: S Push operation success! iten: e Push operation success iten: r Push operation success! iten: t Push operation success iten: 9 Empty the content of the stack with the following order : stressed Stack is empty

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!