Answered step by step
Verified Expert Solution
Question
1 Approved Answer
trings Assignment Instructions REARRANG ME STRING: This program Step 1: Start with the following program # include #includec string> using nanespace std; int main() string
trings Assignment Instructions REARRANG ME STRING: This program Step 1: Start with the following program # include #includec string> using nanespace std; int main() string nane1 Cooper, Sheldon" string name2 Trebor, Robert string nane; string last, first, fullname; int comma, en; name nane1; //Use find function to locate the position of the comma (store in comma) //Use length function to deternine the length of the string (store in len) //Use substr function to get the last name (store in last) /Use substr function to get the first name (store in first) //Use the operator to store the full name (first+last) (store in fullname) //Print out the full name //Print out the full name backwards name name2 ; //Do the above steps again. Since you saved the second name in the variable /ame you can just copy the lines of code system("pause"); return 0; Step 2: Comment Block: Add a comment block in your program! Step 3: Some Hints: Below is an example of using the find command: 1. Say you were trying to find the location of the space in the string name: int space; nane namel
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