#include <iostream> using namespace std; struct stInfo { string FirstName, FirstName1;…
- User
#include using namespace std; struct stInfo { string FirstName, FirstName1;
string LastName, LastName1;
}; stInfo ReadInfo() { stInfo Info;
cout << " please enter your First Name\n"; cin >> Info.FirstName; cout << " please enter your last Name" << endl; cin >> Info.LastName; cout << " please enter your First Name\n"; cin >> Info.FirstName1; cout << " please enter your last Name" << endl; cin >> Info.LastName1; return Info;
} string GetFullName(stInfo Info) { string FullName =""; FullName = Info.FirstName + " " + Info.LastName; return FullName;
string FullName1 = ""; FullName = Info.FirstName1 + " " + Info.LastName1; return FullName1;
} void PrintFullName(string FullName) {
cout << "\n Your Full name is: " << FullName <<endl;
} int main() {
PrintFullName(GetFullName(ReadInfo()));return 0;
}
- Assistant
Your code seems to aim at collecting names from a user and then displaying the full name. However, there are a few issues that need to be addressed:
- The
GetFullNamefunction is only returning the first name's full name and does not make use of the second set of names.
- The