Think Pair Share 1
- Due Jan 29, 2020 by 10am
- Points 1
- Available after Jan 29, 2020 at 9am
On a piece of paper, answer the following question.
The code below prompts the user for the name of an item to purchase, then reads the name in. The prompt currently is displayed like this:
Please enter the name of the item you would like to purchase:>
Write down the corrected line of code to make the prompt appear like this:
Please enter the name of the item you would like to purchase:
>
Note that the ">" should appear on a new line with a space after it.
Here's the program.
#include <iostream>
using namespace std;
int main(){
string productName;
cout << "Please enter the name of the item you would like to purchase:>";
getline(cin, productName);
return 0;
}