What is the output of the following program? #include #include #include "myStack.h" using namespace std; template void mystery(stackType& s, stackType& t); int main() {     stackType stack1;    ...


What is the output of the following program?


#include #include

#include "myStack.h"


using namespace std;


template void mystery(stackType& s, stackType& t);

int main()


{


stackType stack1;     stackType stack2;     stackType newStack;

    string fNames[] = {"Chelsea", "Kirk", "David",


                        "Stephanie", "Bianca", "Katie", "Holly"};


    string lNames[] = {"Jackson", "McCarthy", "Miller",


                       "Pratt", "Hollman", "Smith", "Klien"};


    for (int i = 0; i <>


    {


        s1.push(fNames[i]);


        s2.push(lNames[i]);


    }


    mystery(stack1, stack2, newStack);


    while (!newStack.isEmptyStack())


    {


        cout <>


        newStack.pop();


    }


 }


template void mystery(stackType& s1, stackType& s2,              stackType& s3,)

 {


    while (!s1.isEmptyStack() && !s2.isEmptyStack())


    {


        s3.push(s1.top() + " " + s2.top());


        s1.pop();


        s2.pop();


    }


 }


May 18, 2022
SOLUTION.PDF

Get Answer To This Question

Submit New Assignment

Copy and Paste Your Assignment Here