>>WHAT IS WRONG WITH THIS CODE?
1) You do not use code tags
2) You haven't included the necessary library
3) I don't think you understand what the question is asking, so
understand it before you write the program.
I'll try to break the question down for you :
Write a program that uses cin to read a given name (like Louis) and a family name (like Armstrong) into two string variables, given and family.
//Meaning you have 2 string variables called family and given, and
//you need to ask the user to input a first name and a last name
The program then makes assignments to two other string variables: givenFirst and givenLast. To givenFirst it assigns the concatenation of given, a space, and family.
//means that you need 2 other string variables called givenFirst and
//givenLast. And to givenFirst you need to concatenate or add the
//string variable given, a space and the string variable family.
//Here is an example :
string givenFirst = given + " " + family
To givenLast, it assigns the concatenation of family, a comma followed by a space, and given.
//same concept as above, try it out.
Reputation Points: 840
Solved Threads: 594
Senior Poster
Offline 3,864 posts
since Dec 2008