Question
C++ ONLY This Lab we will write our own string function: 1) Print the words in the string. 2) Sort the words in the String.
C++ ONLY
This Lab we will write our own string function:
1) Print the words in the string.
2) Sort the words in the String.
Step 1: You need to take an input from the user and print the first three words of the string on separate lines. (1 Point)
E.g. the input might be: Remember you are unique, just like everyone else
and the output would be:
Remember
you
are
Step 2: It is similar to the Step 1 but you need to print all the words in the user input string. (1 Point)
E.g. for the input: Remember you are unique, just like everyone else
The output would be:
Remember
you
are
unique,
just
like
everyone
else
Step 3: You need to sort the words according to thier ASCII order and display them. (Extra Credit, 1 Point)
For the above sample input, the output should now be:
Remember
are
else
everyone
just
like
unique,
you
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