Question: C++ use structs/classes to implement 1. (5 points) Ask the user for their first name (store it as a string), then separately ask the user

C++

use structs/classes to implement

1. (5 points) Ask the user for their first name (store it as a string), then separately ask the user to enter their last name (store it as a string). Combine the 2 strings into 1 result string then print the resulting string and also the length of the result string. Remember to include a space between the first and last names.

Note: You can use the string type defined in C++ header file string (#include), this will make combining the strings/finding length of a string more convenient. If using cin to read a string, it will terminate upon encountering a space/tab/new line, so you will have to add a space when constructing the result string. For first/last names consisting of 2 or more words you can use getline(cin, mystring) to read in a whole line including spaces.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Heres the detailed implementation in C using ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!