answersLogoWhite

0


Best Answer

#include<iostream>

#include<vector>

#include<string>

int main()

{

std::vector<std::string> names;

for (int loop=0; loop!=10;)

{

std::cout << ++loop << " enter a name: ";

std::string name;

std::cin >> name;

names.push_back (name);

}

}

User Avatar

Wiki User

10y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Program that input ten names from user c plus plus?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Answer them Thanks very much Write a program which has the user input the names first and last of 10 of your friends Output in a column the list of all the names in the exact?

This sounds like a homework question...


C plus plus get user input without prompting for it?

To prompt a user in C++ you use cout to output the prompt to the console (e.g., the screen). You then use cin to extract the input from the user. So to get user input without a prompt, simply do not output a prompt before accepting input. However, accepting user input without a prompt would be decidedly un-user-friendly, unless you can guarantee the input does not come from the keyboard. If you're not using the console and the program is actually running in an event-driven interface (such as Windows), then you need only trap the keyboard, mouse or other HID messages that are posted to your application via the application's message loop, and act accordingly.


Why would you need to convert a string to a numeric data type?

For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.


A program that uses prompting messages to direct the user's input is running in?

Interactive mode


What is meant by input stream?

An input stream is a character sequence device or buffer from which input can be gathered. The standard input stream is usually a keyboard, data file or the output stream from another program. The user of the program can normally decide where standard input may be redirected from when launching the program, typically defaulting to the keyboard.

Related questions

Answer them Thanks very much Write a program which has the user input the names first and last of 10 of your friends Output in a column the list of all the names in the exact?

This sounds like a homework question...


C plus plus get user input without prompting for it?

To prompt a user in C++ you use cout to output the prompt to the console (e.g., the screen). You then use cin to extract the input from the user. So to get user input without a prompt, simply do not output a prompt before accepting input. However, accepting user input without a prompt would be decidedly un-user-friendly, unless you can guarantee the input does not come from the keyboard. If you're not using the console and the program is actually running in an event-driven interface (such as Windows), then you need only trap the keyboard, mouse or other HID messages that are posted to your application via the application's message loop, and act accordingly.


Is a program with no input an incorrect program?

No, as long as it calculates something, displays something, or otherwise has an output that benefits the user, it is a program. It could be a program that makes a random number, or a program that tells the user a joke from a database.


How do you check a user's text input in C plus plus?

Use an SLR parser algorithm.


Why would you need to convert a string to a numeric data type?

For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.For example, to interpret user input; to read data from a text file or from some other program that produces the data as a string.


A program that uses prompting messages to direct the user's input is running in?

Interactive mode


What is meant by input stream?

An input stream is a character sequence device or buffer from which input can be gathered. The standard input stream is usually a keyboard, data file or the output stream from another program. The user of the program can normally decide where standard input may be redirected from when launching the program, typically defaulting to the keyboard.


Write a program that allows the user to input a word or phrase and then determine if its a palindrome. I need to use a Boolean equals valued Function procedure names IsPalindrome. How?

forward(word) backward(word)


Is user interface part of the operating system?

A user interface (UI) is the part of an operating system, program or device that the user uses to input and receive data


What is two ways in which a user can input a command using a graphical user interface?

1)Use fingers to move things 2)Use mouse


What is a sentence with the word input?

The program requires user input to generate the final output.


C program to print mark sheet of 5 subjects and the number of students is user input?

hhh