1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Brrunno [24]
3 years ago
10

You have the following code: string name; cout << "Enter your name : "; cin >> name; If a user enters "Mary Smith" a

t the prompt for a name, what will name contain after the cin statement
Computers and Technology
1 answer:
iogann1982 [59]3 years ago
5 0

Answer:

The variable name will contain Mary after the cin statement

Explanation:

The standard input statement cin in c++ does not read an entire line. When it is used, it read a value until it encounters a white space. The getline function should be used when you want to read a string that contains more than one word.

The code snipet below has been moderated to use a getline ()

<em>#include <iostream></em>

<em>using namespace std;</em>

<em>int main()</em>

<em>{</em>

<em>    string name;</em>

<em>    cout << "Enter your name : ";</em>

<em>   getline(cin, name);</em>

<em>    cout<<"The name is "<<name<<endl;</em>

<em>    return 0;</em>

<em>}</em>

You might be interested in
Imagine you are having a conversation about simulation training programs with one of your friends (it is a slow night). You are
Marina86 [1]
I'd simply say that everyone has their own opinions. Some people don't want to experience it in real life because they fear they may mess up. Hence why we have simulations of things, to help people who don't want to experience something in real life and prepare them for when they decide to go out and actually do it.
3 0
4 years ago
List of all the storage devices that you use for storing your school projects and assignments then state the reason you chose th
Dmitry [639]

Answer:

I use my oldest computer to store my information

Explanation:

I use my old computer to store things because it does not function properly such as taking a slow time loading or shutting down completely so I use it to store my data.

6 0
4 years ago
Read 2 more answers
For a windows labtop what is the best way to save power when the computer will not be used for an extended period
rjkz [21]

Answer:

Put the Computer to sleep or hibernate Mood

Explanation:

The best way to save power when the computer will not be use for an extended period is to put the computer to sleep or hibernate mood depending on the OS (Operating System) you are using.

For instance in windows 10, all you need do is to Press the Windows key on the keyboard, then click on Sleep.

3 0
3 years ago
List and briefly define the four main elements of a computer.​
777dan777 [17]
-Processor(CPU)
The processor is the important element of the computer. It controls all the operations that are performed by the computer.
-Main Memory(RAM):
The main memory is referred as the primary memory. It is volatile in nature.
It stores the data and programs temporarily. It is a temporary memory.
-I/O Modules:
The I/O modules moves the data between the computer and other peripheral devices of the system.
-System Bus:
The bus that connects the CPU to main memory on the mother board, I/O modules and other components within the system.
7 0
3 years ago
What do dns servers use to help resolve ip addresses to dns names?
VladimirAG [237]
PTR records. Normal job of DNS is the other way around, ie., dns name to ip address. Pointer records are for reverse DNS.
6 0
4 years ago
Read 2 more answers
Other questions:
  • 5. How is shutter speed generally measured? What do the measurements mean?
    7·2 answers
  • Which of the following statements about computer graphics formats is true?
    14·1 answer
  • Triggers are types of buttons seen in the input devices for which platform?
    14·1 answer
  • 1. Empty tags do not have ___________.
    14·1 answer
  • How are status reports useful
    6·1 answer
  • What's your thoughts on people using Brainly to cheat academically?
    11·2 answers
  • 8.
    9·1 answer
  • With which type of satellite is there a propagation delay?
    5·1 answer
  • What command will prevent all unencrypted passwords from displaying in plain text in a configuration file?.
    9·1 answer
  • What is the importance of test documentation?
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!