Question: 1 . Instructions Create a C + + program that utilizes a stack to simulate a text editor s Undo Function. You MUST use stacks
Instructions
Create a C program that utilizes a stack to simulate a text editors 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.
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 programs execution.
Account for spaces between every inserted string. Notice there are no spaces at the
beginning or end.
Examples
inputtxt
Insert Hello
Insert World
Delete World
Delete asdf
Undo
outputtxt
Hello World!
inputtxt
Undo
outputtxt
Insert Stacks are
Insert Fun
Undo
Undo
inputtxt
Insert Lorem ipsum
Delete ipsum
Insert dolor sit
Undo
outputtxt
Lorem
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
