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]
2 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]2 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
What does in-private or incognito browsing do?
Aleks04 [339]

All it does it let you browse the internet, but whatever you look up, it isn't put on your browser history.
5 0
3 years ago
Choose all the items that represent potential ways to find a job opening.
NeX [460]

Answer:

company website

Explanation:

4 0
2 years ago
True or False: At the Company level, users will only have access to view projects to which they have been specifically granted a
Viktor [21]

Answer:here the link

Explanation:

4 0
3 years ago
Read 2 more answers
A set of programs that enable the hardware to process data is _____.
Mnenie [13.5K]
The most appropriate answer is C !! software os used for using hardware !!
4 0
3 years ago
Describing light years
kogti [31]

Answer:

For most space objects, we use light-years to describe their distance. A light-year is the distance light travels in one Earth year. One light-year is about 6 trillion miles (9 trillion km). That is a 6 with 12 zeros behind it!

5 0
3 years ago
Other questions:
  • Which statement describes the word "iterative"?
    7·2 answers
  • Musccanic Inc., a company that manufactures microprocessors, updates the technology used in its microprocessors once every four
    15·1 answer
  • To hide gridline when you display or print a worksheet
    14·1 answer
  • When creating a chart or graph, which should be completed first?
    9·2 answers
  • Reading a news release about a product is an example of <br> research.
    9·1 answer
  • Write a program that reads a file that contains only integers, but some of the integers have embedded commas, as in 145,020. The
    10·1 answer
  • 1. Write a statement that opens the file Customers.dat as a random access file for both reading and writing.
    9·1 answer
  • Give an example of an occasion when you used logic to solve a problem
    7·1 answer
  • What java syntax allows me to take user input.
    11·1 answer
  • Screen reading for extended periods can cause___________ _____________, so the position the monitor to minimize glare and give y
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!