Question: Using the iostream and string libraries (not cstdio/cstring), write a program that: 1. First, gets the user to enter a line of text, reads the
Using the iostream and string libraries (not cstdio/cstring), write a program that: 1. First, gets the user to enter a line of text, reads the entire line into a string variable, then tells the user how many characters were in their entered line of text. 2. Next, gets the user to enter four "words", reading each into separate string variables, then concatenates the middle two strings together and stores the result in another string variable. (For example, if their four words were "my". "160", "FINAL", and "exam" then the concatenated string's content would be "160FINAL".) 3. Finally, the program displays the first and last characters from the concatenated string. (For example, for "160FINAL" the characters would be '1' and 'L.)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
