How JustAnswer Works:
  • Ask an Expert
    Experts are full of valuable knowledge and are ready to help with any question. Credentials confirmed by a Fortune 500 verification firm.
  • Get a Professional Answer
    Via email, text message, or notification as you wait on our site.
    Ask follow up questions if you need to.
  • 100% Satisfaction Guarantee
    Rate the answer you receive.
Ask Raj Your Own Question
Raj
Raj, Engineer
Category: Homework
Satisfied Customers: 1290
Experience:  4 + Experiance in IT Industry
16752232
Type Your Homework Question Here...
Raj is online now
A new question is answered every 9 seconds

/** * * driver.cpp - This file contains the driver code

This answer was rated:

/**
*
* driver.cpp - This file contains the driver code to test the
* linkedStackType class implementation
*
* TODO: Include your name and course number here.
*/

#include
#include

#include "linkedStack.h"

using namespace std;

template
void printStack(linkedStackType& stack);

template
bool isEqual(linkedStackType& stack1, linkedStackType& stack2);

int main(int argc, char **argv)
{
linkedStackType stack1;
linkedStackType stack2;
linkedStackType stack3;
linkedStackType stack4;
linkedStackType stack5;

// Add some items to stack 1
stack1.push(10);
stack1.push(21);
stack1.push(34);

// Add some items to stack 2
stack2.push(1);
stack2.push(2);
stack2.push(3);
stack2.push(4);

// Add some items to stack 3
stack3.push(10);
stack3.push(11);
stack3.push(43);

// Add some items to stack 4
stack4.push(10);
stack4.push(21);
stack4.push(34);

// Add some items to stack 5
stack5.push(1);
stack5.push(2);
stack5.push(3);
stack5.push(4);

// Check if some of the stacks are equal
cout << "stack1 is equal to stack4 (0=no 1=yes)=" << isEqual(stack1, stack4);
cout << endl;
cout << "stack1=";
printStack(stack1);
cout << "stack4=";
printStack(stack4);

// Check if some of the stacks are equal
cout << "stack2 is equal to stack1 (0=no 1=yes)=" << isEqual(stack2, stack1);
cout << endl;
cout << "stack2=";
printStack(stack2);
cout << "stack1=";
printStack(stack1);

// Check if some of the stacks are equal
cout << "stack1 is equal to stack3 (0=no 1=yes)=" << isEqual(stack1, stack3);
cout << endl;
cout << "stack1=";
printStack(stack1);
cout << "stack3=";
printStack(stack3);

// Check if some of the stacks are equal
cout << "stack2 is equal to stack5 (0=no 1=yes)=" << isEqual(stack2, stack5);
cout << endl;
cout << "stack2=";
printStack(stack2);
cout << "stack5=";
printStack(stack5);

cout << "\n** Press any key to continue **\n";
getchar();

return 0;
}

template
void printStack(linkedStackType& stack)
{
Type item;
linkedStackType tmpStack = stack;

while (stack.isEmptyStack() == false)
{
item = stack.top();
stack.pop();
cout << item << " ";
}

cout << endl;

stack = tmpStack;

}

template
bool isEqual(linkedStackType& stack1, linkedStackType& stack2)
{
// TODO: Implement the predicate function that will test if two given
// stacks are equal.

return false;
}
Hi There,

I will be helping you with this Question as well.
Please post the files you have using the same process of www.wikisend.com

Thank you
Customer: replied 3 years ago.

LinkedStack files. Needed same as other by 9pm c.s.t. 25 Aug 13


 


http://wikisend.com/download/191292/driver.cpp


http://wikisend.com/download/528748/linkedStack.h

Got this one as well.
Will work on this once I finish the first one.
Customer: replied 3 years ago.

Thanks Raj

Ok I have posted the solution for the other one and am working on this one.

Based on urgency and effort required I have sent an Underprice report for this Question. Please check you e-mail for the new proposed price for the Question and reply here.

Thank you
THIS ANSWER IS LOCKED!

You need to spend $3 to view this post. Add Funds to your account and buy credits.
Raj and 2 other Homework Specialists are ready to help you
Thank you for your Feedback

In Future to request any new Question to me just begin your Question with TO RAJ followed by the Question in the following format:

TO RAJ: Followed by the Question.

Have a Good Day.

Related Homework Questions