(string Concatenation) Write a program that separately inputs a first name and a last name and concatenates the two into a new string.

What will be an ideal response?


```
// Program reads a first name and last name and concatenates the two.
#include
#include
using namespace std;

int main()
{
// declare two strings
string first;
string last;

cout << "Enter first name: ";
cin >> first;

cout << "Enter last name: ";
cin >> last;

// use function append to insert space and string last
first.append( " " ).append( last );
cout << "The full name is: " << first << endl;
} // end main
```
Enter first name: John
Enter last name: Green
The full name is: John Green

Computer Science & Information Technology

You might also like to view...

After a finally block has finished executing:

a. control proceeds to the first statement after the finally block. b. control returns to the throw point. c. the app exits. d. control proceeds to the first statement after the last catch block.

Computer Science & Information Technology

What is wrong with this function?

``` void Divide( int x, int y ) { int remainder, quotient; quotient = x/y; remainder = x%y; return (quotient, remainder); } ``` A. You can’t have a comma in the return statement. B. The return type is void. C. You can’t delare new variables in this function. D. Both A & B.

Computer Science & Information Technology

You can fill text with a gradient as long as it ____.

A. does not have a stroke applied B. has been converted to outlines C. uses a thick font D. it is selected with the Type tool

Computer Science & Information Technology

To maximize the number of cells visible on the screen, use ________ view

Fill in the blank(s) with correct word

Computer Science & Information Technology