Question: #include #include using namespace std; int flipfirst ( string& first _ name, string& last _ name ) { if ( first _ name.empty ( )
#include
#include
using namespace std;
int flipfirststring& firstname, string& lastname
if firstname.empty lastname.empty
return ;
char originallastfirstletter lastname; Store the original first letter of the last name
firstname lastname;
lastname originallastfirstletter; Assign the original first letter of the last name
return ;
int main
string firstname, lastname;
cout "Enter your first name: ;
getlinecin firstname;
cout "Enter your last name: ;
getlinecin lastname;
int result flipfirstfirstname, lastname;
if result
cout "After flipping the first letters: firstname lastname endl;
else
cout "One or both of the names are empty." endl;
return ;
Help fix output
Enter your first name: Ashley
Enter your last name: Castro
After flipping the first letters: Cshley Castro
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
