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
Effectus [21]
3 years ago
15

In Java Write a program that prompts the user for a name (any String value would work for testing), and print a hello message to

the console with the input string after hello. (if the user typed 'class' then the console will display 'Hello class').
Computers and Technology
1 answer:
BabaBlast [244]3 years ago
7 0

Answer:

// program in java.

// package

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 the name

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

 // read name

String name=scr.nextLine();

 // print the hello message

System.out.println("Hello "+name);

   }catch(Exception ex){

       return;}

}

}

Explanation:

Create a Scanner object to read name from user.Read name from user and assign it to variable "y_name".Then print the message Hello followed by the name.

Output:

Enter your name:Krish                                                                                                      

Hello Krish

You might be interested in
You are given two processors P1 and P2 that execute the same instruction set but have different architectures. The instructions
mafiozo [28]

The answer & explanation for this question is given in the attachment below.

3 0
3 years ago
What happens to formulas with relative cell references when they are copied using the fill handle?
Masteriza [31]
The correct answer is D
4 0
4 years ago
Which part of project management involves determining the overall work? Breakdown Incomes Scope Time
Oliga [24]

Answer:

Incomes

Explanation:

Project management has to do with the process of achieving a set goal with the help of a team within a specified time. Most times, the main problem that comes with project management is completing the project within the available constraints.

No project can start up without funds, which in this case is called income and this is the part of the project that determines the overall work.

6 0
3 years ago
What is the current through R1?
patriot [66]
I = V/R. So the answer is 9/200 = 0.045A = 45mA which is B
8 0
3 years ago
Discussion Topic:
hodyreva [135]

Answer:

Prevents lagging

Explanation:

This prevents the website from being slow and upto shape so those who access it dont have difficulties

7 0
2 years ago
Other questions:
  • A ________ is a collection of forms, reports, queries, and programs that serves as an intermediary between users and database da
    6·1 answer
  • What’s good and bad about having social media?
    14·2 answers
  • What career cluster does a fish and game warden fall in?
    14·1 answer
  • A _____ is the useful part of a transmission through a network.
    15·1 answer
  • man who is colorblind marries a woman who has normal color vision and is not a carrier of color blindness. If this couple has a
    15·1 answer
  • If the speakers are not working on a laptop, what could be the problem besides the speakers?
    5·1 answer
  • Which administrative tool can you use to check your computer's health or troubleshoot problems with the operating system or soft
    11·2 answers
  • What are listed in the vertical columns across the top of the Event Editor?
    5·2 answers
  • What happens to a message when it is deleted?
    11·1 answer
  • Why do we need to learn about engineering and technology?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!