Explore BrainMass

Explore BrainMass

    queue and stack in C++

    Not what you're looking for? Search our solutions OR ask your own Custom question.

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    I need two separately programs from the same code.

    1.) Modified the code so it has a Pop() function that makes the function of a Queue.

    Example:

    Input:

    Enter Id: 1
    Enter Name: Ana

    Enter Id: 2
    Enter Name: Carlos

    Ouput:
    (After a pop):

    Id: 1
    name: Ana

    2.) Modified the code so it has a Pop() function that makes the function of a Stack.

    Example:

    Input:

    Enter Id: 1
    Enter Name: Ana

    Enter Id: 2
    Enter Name: Carlos

    Ouput:
    (After two pops):

    Id: 2
    Nombre: Carlos

    Id: 1
    Nombre: Ana

    © BrainMass Inc. brainmass.com November 30, 2021, 1:42 am ad1c9bdddf
    https://brainmass.com/computer-science/cpp/queue-stack-c-122501

    Attachments

    Solution Summary

    It modifies the codes so it has a Pop() function that makes the function of a Queue or a Stack, respectively. The response was rated '5/5' by the student who posted the question originally.

    $2.49

    ADVERTISEMENT