|When faced with a problem like this you need to do a little debugging. I would suggest that you add the line|
cout << inp << endl;
as the first line of your "respond" function. Now run the program, try a few inputs, see what is output and think about why.
Try as inputs:
how are you
how hi you
Inspect the output for each of the 3 lines and see if is what you expect. If not, try to think why it is not what you expected. Then you will understand why your program is not working. Next you have to think about how you can solve that problem; that's another question. If you can't answer it, come back and tell us what your new problem is.
(Sorry if I'm being a little cryptic and not just giving you the answer. I sincerely believe that you will learn more, and become a better programmer, by working through this exercise by yourself than if I just tell you what is wrong.)