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
zimovet [89]
3 years ago
9

Assume that name has been declared suitably for storing names (like "Misha", "Emily" and "Sofia"). Assume also that stdin is a v

ariable that references a Scanner object associated with standard input Write some code that reads a value into name then prints the message "Greetings, NAME" on a line by itself, where NAME is replaced the value that was read into name. For example, if your code read in "Rachel" it would print out "Greetings, Rachel" on a line by itself.
Computers and Technology
1 answer:
zaharov [31]3 years ago
5 0

Answer:

// program in java.

import java.util.*;

// class definition

class Main

{// main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // object to read input

Scanner scr=new Scanner(System.in);

 // ask to enter name

System.out.print("Enter Your name: ");

 // read name from user

String NAME=scr.nextLine();

// print message

System.out.println("Greetings,"+NAME);

     

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read name from user with the help of scanner object and assign it to variable "NAME".Then print a Greetings message as "Greetings,NAME" where NAME will be  replaced with user's input name.

Output:

Enter Your name: Rachel                                                                                                    

Greetings,Rachel

You might be interested in
To what extent do you think st. cyprian was effective in his efforts to bring inherited christian teachings to bear on the unpre
Pepsi [2]

St. Cyprian of Catharge is a bishop who is often called the African Pope. His martyrdom justified his status and showed his holiness through the judgments of the church. His assertions strongly propose that he is conscious that he is in a situation that he is being slated for intensifying and spreading the factional partition through rigorist inflexibility by his adversaries in Rome. He knew that the advertising line” Feticissimus” together with his troupe would be vending in Rome. 

4 0
3 years ago
What error occurs in the following program? #include using namespace std; int main() { int number1, number2, sum; cout <<
Nady [450]

Answer:

1. ‘cout’ was not declared in this scope.

2. ‘cin’ was not declared in this scope.

3. lvalue required as left operand of assignment.

Explanation:

The code gives the error cout and cin was not declare. This error means, we not include the library where they define.

cout and cin is the input/output instruction and they include in the library iostream file.

the last error is lvalue required as left operand of assignment.

lvalue means the assignable value, we actually do the wrong assignment.

number1 + number2 = sum;

here, sum is is the assignment variable. so, it must be in the right side of the '=' operator.

sum = number1 + number2 ;

Now, the above is correct. the value number1 plus number2 is assign to sum.

7 0
3 years ago
Yo, what's the tinyclick.ml/7hTq link?? I don't trust it, but I'm curious-
Rashid [163]
<h2>Answer:</h2>

<u><em>Usually, random people will say that on your questions page to give you a virus but then that link doesn't look like the same link I see every day. I would still not click it just in case.</em></u>

<h2>Explanation:</h2>

<em>Have a good one!</em>

<h2>( ◑‿◑)ɔ┏--┑٩(^◡^ )</h2>
5 0
3 years ago
As u type where does excel display the entry
grigory [225]

Answer:

The Active cell inside Excel Worksheet is used to identify the cell which is currently active. The thick border gridlines around the cell indicates that it is the Active cell inside Excel Worksheet. The Active cell is where the focus is on and where the data will be entered when a key is typed on keyboard.

5 0
3 years ago
Can someone help me write an algorithm and a flow chart pls for question 3
emmainna [20.7K]

for i in range(20, 51, 2):

      print(i)

6 0
3 years ago
Other questions:
  • Consumers’ ability to ""time shift"" programs using DVRs and Internet video and other situations that lack simultaneity is an ex
    6·1 answer
  • Which is a difference between the systems development life cycle (SDLC) and extreme programming (XP)?
    7·1 answer
  • Help me 28pts to anyone who answer this
    5·2 answers
  • Describe what a structure is in a living thing?
    9·1 answer
  • Which category of software would programming languages fall into?
    8·2 answers
  • How can data be calculated?
    14·2 answers
  • Difference between software developer and software engineer.
    6·1 answer
  • Which of the following is one of the tools used by a Python IDE that helps prevent syntax errors?
    9·1 answer
  • How communication skills are different from self management skills
    10·2 answers
  • Which device allows users to directly hear data from a computer
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!