Question: 1 . Instructions Create a C + + program that utilizes a stack to simulate a text editor s Undo Function. You MUST use stacks

1. 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.
2. 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.
3. 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.
4. Examples
input1.txt
Insert Hello
Insert World!
Delete World!
Delete asdf
Undo
output1.txt
Hello World!
input2.txt
Undo
output2.txt
Insert Stacks are
Insert Fun!
Undo
Undo
input3.txt
Insert Lorem ipsum
Delete ipsum
Insert dolor sit
Undo
output3.txt
Lorem

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!