Question: Need help with C++ code problem: included files that need to be edited: if you can include make file too that would be great Thank

Need help with C++ code problem:

Need help with C++ code problem: included files that need to be

edited: if you can include make file too that would be greatThank You Requirements You will create a program that can ran in

included files that need to be edited:

two modes, test mode and parser mode. From the command-line the user

will decide if they want to launch your test suite (-t) or

if you can include make file too that would be great Thank You

Requirements You will create a program that can ran in two modes, test mode and parser mode. From the command-line the user will decide if they want to launch your test suite (-t) or enter parser mode (-p). Sample executions: To enter test mode $> ./labo2 -t To enter parser mode $> ./labo2 -p Test Mode Before attempting to use our Stacks to solve problems, we need to make sure they work. I have provided you with some starter tests that you must implement. You will also be required to add new tests for methods not mentioned here Each test should be ran in isolation, meaning the tests could be run in any order and they don't share any objects/data. Sample Test Output $>./labo2 -t Test #1: New stack is empty: PASSED Test #2: Push on empty stack makes it non-empty: PASSED Test #3: Popping all all elements makes stack empty: FAILED Test #4: Copy constructor copies all elements in correct order: FAILED Stack Tester class Runs a battery of tests to verify that our Stack is working Has a single entry point called run Tests() Each test prints what test is currently running and if the Stack passed or failed Each test method should work in a vacuum, meaning tests shouldn't pass Stack objects from test to test Sample StackTester.h class StackTester public: StackTester(); //This will call all your test methods void runTests(); private: * @brief Creates an empty stack and verifies isEmpty()) returns true void test01(); /** * @brief Creates an empty stack pushes 1 value, verifies isEmpty() returns false **/ void test02(); * @brief Creates an empty stack, then pushes once, pops once, and verifies is Empty returns true **/ void test03(); //more test methods as needed Parser Mode Once you know your Stack is working, begin working on parser mode. In this mode, the user will be allowed to enter a single string consisting of left and right curly braces. You must verify whether or not the sequence is balanced. Example runs: $>./lab02 -p Enter your sequence: {} Sequence is balanced. $>./lab02 -p Enter your sequence: }{ Sequence is not balanced. $>./lab02 -p Enter your sequence: {{{}} Sequence is not balanced. $>./lab02 -p Enter your sequence: {}{} Sequence is balanced. $>./lab02 -p Enter your sequence: {{{{{{}}}}}}{{{{{}}}}}{}{}{}{}{}{}{{}} Sequence is balanced. #ifndef STACKOFCHARS_H #define STACKOFCHARS_H class StackofChars private: Node* m_top; public: StackofChars(); StackofChars (const StackofChars& orig); -StackofChars(); void operator=(const StackofChars& rhs); /** Here's an example of a doxygen comment block. Do this for all methods * @pre None * @post entry is added to top of the stack * @param entry, the element to be added to the stack * @throw None **/ void push(char entry); /** Here's an example of a doxygen comment block. Do this for all methods * @pre Stack is non-empty * @post Top element is removed from the stack * @param None * @throw None **/ void pop(); char peek() const; bool isEmpty() const; }; #endif Node.h #ifndef NODE_H #define NODE_H class Node private: char m_entry; Node* m next; public: Node (char entry); char getEntry() const; void setEntry(char entry); Node* getNext() const; void setNext (Node* next); #endif Requirements You will create a program that can ran in two modes, test mode and parser mode. From the command-line the user will decide if they want to launch your test suite (-t) or enter parser mode (-p). Sample executions: To enter test mode $> ./labo2 -t To enter parser mode $> ./labo2 -p Test Mode Before attempting to use our Stacks to solve problems, we need to make sure they work. I have provided you with some starter tests that you must implement. You will also be required to add new tests for methods not mentioned here Each test should be ran in isolation, meaning the tests could be run in any order and they don't share any objects/data. Sample Test Output $>./labo2 -t Test #1: New stack is empty: PASSED Test #2: Push on empty stack makes it non-empty: PASSED Test #3: Popping all all elements makes stack empty: FAILED Test #4: Copy constructor copies all elements in correct order: FAILED Stack Tester class Runs a battery of tests to verify that our Stack is working Has a single entry point called run Tests() Each test prints what test is currently running and if the Stack passed or failed Each test method should work in a vacuum, meaning tests shouldn't pass Stack objects from test to test Sample StackTester.h class StackTester public: StackTester(); //This will call all your test methods void runTests(); private: * @brief Creates an empty stack and verifies isEmpty()) returns true void test01(); /** * @brief Creates an empty stack pushes 1 value, verifies isEmpty() returns false **/ void test02(); * @brief Creates an empty stack, then pushes once, pops once, and verifies is Empty returns true **/ void test03(); //more test methods as needed Parser Mode Once you know your Stack is working, begin working on parser mode. In this mode, the user will be allowed to enter a single string consisting of left and right curly braces. You must verify whether or not the sequence is balanced. Example runs: $>./lab02 -p Enter your sequence: {} Sequence is balanced. $>./lab02 -p Enter your sequence: }{ Sequence is not balanced. $>./lab02 -p Enter your sequence: {{{}} Sequence is not balanced. $>./lab02 -p Enter your sequence: {}{} Sequence is balanced. $>./lab02 -p Enter your sequence: {{{{{{}}}}}}{{{{{}}}}}{}{}{}{}{}{}{{}} Sequence is balanced. #ifndef STACKOFCHARS_H #define STACKOFCHARS_H class StackofChars private: Node* m_top; public: StackofChars(); StackofChars (const StackofChars& orig); -StackofChars(); void operator=(const StackofChars& rhs); /** Here's an example of a doxygen comment block. Do this for all methods * @pre None * @post entry is added to top of the stack * @param entry, the element to be added to the stack * @throw None **/ void push(char entry); /** Here's an example of a doxygen comment block. Do this for all methods * @pre Stack is non-empty * @post Top element is removed from the stack * @param None * @throw None **/ void pop(); char peek() const; bool isEmpty() const; }; #endif Node.h #ifndef NODE_H #define NODE_H class Node private: char m_entry; Node* m next; public: Node (char entry); char getEntry() const; void setEntry(char entry); Node* getNext() const; void setNext (Node* next); #endif

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!