Ok, I'm wanting to do the following...
A C++ program that can edit a sentence with word insertions and deletions. You can assume
the sentence has words and numbers separated by spaces and punctuation symbols.
The input is a regular text file, where each line is terminated with an end-of-line character(s). Each line will contain a list of words. There are insert, delete and print commands to manipulate the list. Insertion and deletion have the word and position as parameters. Notice worod positions may change after a word is inserted or deleted. The edited string is saved to the output file when the input commands file ends.
Input file example:
This is is an an icorrect sntence
Input commands file example with the print output:
Input Output
delete("is",2)
print "This is an an icorrect sntence"
delete("an",3)
print "This is an icorrect sntence"
delete("icorrect",4)
print "This is an sntence"
insert("incorrect",4)
print "This is an incorrect sntence"
delete("sntence",5)
insert("sentence",4)
print "This is an incorrect sentence"
Output Example:
This is an incorrect sentence.
Does anybody know how to do this? It seems very complicated!