Answered step by step
Verified Expert Solution
Question
1 Approved Answer
#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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started