search/replace user string project

Hello all,

Need some help writing a simple search and replace program for class. It's supposed to work like the search in replace in a simple text editor. Due to a retiring prof last semester, much of this wasn't covered and I am being thrown head first into it. Not looking for the entire prog, just a few pointers to get me started.

What it needs to do:

//1 User to enter sentence
//2 Display user sentence
//3 User to select word to replace
//4 User inputs word to replace selected word
//5 Prints sentence with word replaced
//6 Asks user if they want to repeat
//7 Prog repeats till user exits


If anyone has any tips on how to get started please let me know. I am not sure how to search a user string and replace their selected substring with a new substring they input.

Thanks!!
I don't know how much this is over your head, I assume you know the basics of programming in C++.

For user input :
http://www.cplusplus.com/reference/string/getline/

For string manipulation see Modifiers and String operations at:
http://www.cplusplus.com/reference/string/string/

Pseudo-code:
1
2
3
4
5
6
7
8
do {
    Ask for the sentence
    Ask for the word to be replaced
    Ask for the word to replace with
    Do the replacing
    Print out the result
    Ask the user if he wants to continue
} while (the user wants to continue);

Topic archived. No new replies allowed.