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
Write a Java program that accepts an integer number from the user between 20 and 100. Next, divide the number by 12 and determin
Eddi Din [679]
Import java.util.Scanner;
class hola
{
public static void main(String[]args)
{
Scanner x=new Scanner(System.in);
int a=x.nextInt();
int b;
if(a>20&&a<100)
{
b=a%12;
if(b%2==0){
System.out.print("es par"+b);
}
else{
System.out.print("es impar"+b);
}
}
}

}
4 0
4 years ago
Write a print10() method that takes an array as a parameter and prints out the first 10 words of the array.
hammer [34]

Answer:

This question is answered using Java programming language:

public static void print10(String[]arr){

    for(int i =0; i<10;i++){

System.out.println(arr[i]);

    }

}

Explanation:

This line defines the method

public static void print10(String[]arr){

This iterates from 0 to 9 index of the array. In other words, 1st to 10th

    for(int i =0; i<10;i++){

This prints the required output (one on a line)

System.out.println(arr[i]);

    }

}

<em>Refer to attachment for the complete program that includes the main method.</em>

Download txt
3 0
3 years ago
____ refers to typing your entire e-mail message or discussion group post using only capital letters.
Over [174]
The answer to this question is: Shouting
7 0
3 years ago
PLEZ ANSWER QUICK
harina [27]
The answer is URL. ........
7 0
3 years ago
Read 2 more answers
Regarding the Internet of Things (IoT), a business involved in utilities, critical infrastructure, or environmental services can
jeka94

Answer:

A. true

Explanation:

Based on the information provided within the question it can be said that the statement is completely true. This is because, traffic-monitoring applications have the main function of monitoring and analyzing the flow of traffic of one or various different items. Which can be applied to the business involving utility, infrastructure, and environmental services by monitoring the specific items regarding each business. Therefore making sure that enough product is entering or leaving each business as it is suppose to. As well as providing stock analysis and defective product alerts.

6 0
4 years ago
Other questions:
  • The source ip address is 164.109.28.3 subnet mask of 255.255.128.0 network address is
    7·1 answer
  • Prior to the release of a movie, a film studio launches a website that allows people to play online games featuring actors in th
    15·2 answers
  • i see tabs named mowed and Ramsey i tried shredding them and deleting them and ending all the processes but they start duplicati
    13·1 answer
  • To use the mail merge feature in Access, the first step is to start the Microsoft Word Mail Merge Wizard.
    11·1 answer
  • What will be the values of ans, x, and y after the following statements are executed? int ans = 35, x = 50, y =50; if ( x &gt;=
    7·2 answers
  • Management is as old as human civilization. justify this statement​
    7·1 answer
  • Which steps will open the Access Options dialog box? Complete each statement using the drop-down menus
    14·2 answers
  • Describe a situation when you would use a conditional statement in a program. Describe the action that would occur when the cond
    10·1 answer
  • Please helpppppppppp​
    8·1 answer
  • 9. These particular machines can be decentralized.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!