Question: COSC 2 4 3 6 Lab 3 : Stacks Instructions Create a C + + program that utilizes a stack to simulate a text editor's
COSC Lab : Stacks
Instructions
Create a C program that utilizes a stack to simulate a text editor's "Undo" Function. You MUST use stacks in your implementation. You may use the standard library stack.
Input Files
The input file will contain multiple commands, representing modifications made to the string, separated by an endl. "Text" will never contain leading andor trailing spaces.
Insert "text" appends "text" to the output string
Delete "text" deletes "text", which will always be a unique substring, from the output string.
Undo Reverts the previous command
Note: All possible warnings may not be given. If you think of an edge case, cover it in your code.
Output Files
Output the string at the end of your program's execution.
Account for spaces between every inserted string. Notice there are no spaces at the beginning or end,
Examples
tableinputtxtoutputtxtInsert "Hello",Hello World!Insert "World!",Delete "World!",Delete "asdf",Undoinpu bxtoutputtxtUndo
There are differenct case scenarios that are tested and i have an argument manager.. so my Main function looks like this:
int mainint argc, char argv
ArgumentManager amargc argv;
ifstream inputamgetinput;
ofstream commandamgetcommand;
ofstream outputamgetoutput;
could you please write out the code in c I'll thumbs up
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
