how to get the answer...anyone can help

Oct 19, 2011 at 2:30pm
Write a program that asks for a user first name and last name separately.
The program must then store the users full name inside a single string and out put it to the string.
i.e.
Input:
John
Smith
Output:
John Smith

★ Modify the program so that it then replaces every a, e, i , o, u w/ the letter z.
i.e.
John Smith -> Jzhn Smzth

★★ Modify the Program so that it reverses the users name
i.e.
John Smith -> htimS nhoJ
Oct 19, 2011 at 2:34pm
I would start by asking the user for their first name.
Then ask them for their second name.
Then combine both names in a single string.
Then output that string.

=P
Last edited on Oct 19, 2011 at 2:34pm
Oct 19, 2011 at 2:36pm
full program plz
Oct 19, 2011 at 2:40pm
No. This isn't a homework service.
Oct 19, 2011 at 2:47pm
std::string::operator+ might be of some use.

a_string = string_a + string_b + "."; //Legal and intuitive if you're using std::strings!

-Albatross
Last edited on Oct 19, 2011 at 2:53pm
Oct 19, 2011 at 2:47pm
ok... but i just want to know the answer
Oct 19, 2011 at 2:50pm
What will you gain if we just tell you the answer? Most likely, nothing. I don't mean this as an insult to your learning capabilities, but rather as a reference to a bit of common knowledge among wise tutors that giving solutions rarely helps the student learn.

I wrote more about this topic here: http://cplusplus.com/articles/DjGEy60M/

-Albatross
Oct 19, 2011 at 2:55pm
thank you...
Oct 19, 2011 at 7:34pm
This probably isnt' his homework, considering he copied it word-for-word from the Beginner Exercises thread at:

http://www.cplusplus.com/forum/articles/12974/
Oct 19, 2011 at 7:52pm
That makes my point even more relevant, as the OP wouldn't even get a good grade for the assignment. :)

-Albatross
Oct 19, 2011 at 8:10pm
This probably isnt' his homework, considering he copied it word-for-word from the Beginner Exercises thread at:

http://www.cplusplus.com/forum/articles/12974/


Maybe some CS teachers are starting to steal questions from this site the way their students are stealing the answers???
Oct 19, 2011 at 8:18pm
I guess maybe I'm too cynical. I just assume the worst =P
Topic archived. No new replies allowed.