Question: String operations Inside the my _ code ( ) function, define three string objects ( object is preferred over variable because string is
String operations
Inside the mycode function, define three string objects object is preferred over "variable" because string is a class named alphabetic, numeric, and alphanumeric. All strings should initially be empty. Your output should be written to sout stringstream. Perform the following operations on these strings:
Using the length member function, output to sout stringstream the length of the alphabetic string and an endline character.
Assign the lowercase letters of the alphabet in ascending order followed by the uppercase letters of the alphabet in ascending order to alphabetic.
Again, using the length member function, output to sout stringstream the new length of the alphabetic string and an endline character.
Using string indexing, output to sout stringstream the last alphabetic letter and an endline character. Remember that string and array indices start at
Assign the digits in ascending order to numeric.
Assign the alphabetic string to the alphanumeric string.
Append the numeric string to the alphanumeric string.
Using the find member function, output to sout stringstream the position of YZ in the alphanumeric string and an endline character.
Using the substr member function, output to sout stringstream the alphanumeric substring that starts at index and is characters long and an endline character. Use C to complete this work
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
