Word processors incorporate an important function called undo which when pressed, will delete the most recently added input from the list/sentence. Write an algorithm in pseudocode that implement the following 3 functions. Choice: 1: typeDocument() 2: undo() 3. printDocument() If choice 1 is selected, the function , typeDocument() is called which accept input or allow user to type/add words into document. This is inserted into a data structure. Before insertion, a check if there is still space is performed. If choice 2 is selected, the function, undo() which undo most recent insertion is called. Also, test if there is anything to undo before the operation complete successfully. If user select choice 3, the function printDocument() is called and prints out the content of the document BEFORE and AFTER the undo() operation. For any other choice entered, display the message "Wrong choice entered, please try again!!"
Word processors incorporate an important function called undo which when pressed, will delete the most recently added input from the list/sentence.
Write an
Choice:
1: typeDocument()
2: undo()
3. printDocument()
If choice 1 is selected, the function , typeDocument() is called which accept input or allow user to type/add words into document. This is inserted into a data structure. Before insertion, a check if there is still space is performed. If choice 2 is selected, the function, undo() which undo most recent insertion is called. Also, test if there is anything to undo before the operation complete successfully. If user select choice 3, the function printDocument() is called and prints out the content of the document BEFORE and AFTER the undo() operation. For any other choice entered, display the message "Wrong choice entered, please try again!!"
Trending now
This is a popular solution!
Step by step
Solved in 2 steps