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
Katena32 [7]
3 years ago
11

Write a program that does the following:

Computers and Technology
1 answer:
Nataly_w [17]3 years ago
8 0

Answer:

Following is the program in Java language:

import java.util.*;//import package

public class Main // main class

{

public static void main(String[] args) // main method

{

    String  firstname,lastname; // Declare the two String variables

    Scanner ob=new Scanner(System.in); // create a object of scanner //class

    System.out.println("Enter the first name:");  // Prompt the user for // enter the first name

   firstname=ob.nextLine();// Read in the first name by user

    System.out.println("Enter the last name:"); // Prompt the user for last //name

   lastname=ob.nextLine();// Read in the last name by user

   System.out.println("Hello " + firstname +' ' +lastname); // print the //firstname,lastname

}

}

Output:

Enter the first name:

San

Enter the last name:

ert

Hello San ert

Explanation:

Following are the description of program

  • Declared two variable of string type i.e "firstname"  and "lastname".
  • Create a instance or object  of scanner class .i.e "ob".
  • Prompt the user to enter the first name in the  "firstname" variable
  • Read in the first name by the user by using the method nextLine() in the first name variable
  • Prompt the user to enter the  last name.
  • Read in the last name by the user by using the method nextLine() in the lastname variable.
  • Finally, print the first name and last name.

You might be interested in
Which staff member takes a set of plans and supervises their construction?
jekas [21]

Answer:

Technical director

Explanation:

Someone else's models and designs ,building, decoration, installation, service, hit, and processing supervises by the technical director.

6 0
3 years ago
Ania has written this SimpleStopwatch class. In which line is she measuring the elapsed time?
babunello [35]

Answer:

Mona

Explanation:

6 0
3 years ago
Which best describes inserting a table using the Table Gallery
balandron [24]
The table gallery is to help you create the table.
4 0
3 years ago
Read 2 more answers
You want to look up colleges but exclude private schools. Including punctuation, what would you
Orlov [11]

Answer:

the 3rd

Explanation:

8 0
3 years ago
Read 2 more answers
Can someone help me with this
Alex787 [66]
I’m not sure but I think it belongings.
5 0
3 years ago
Other questions:
  • A cast is required in which of the following situations? a. using charAt to take an element of a String and store it in a char b
    7·1 answer
  • You use a(n) ____ variation when a use case is less specific than others, and you want to be able to substitute the more specifi
    8·1 answer
  • Which of the following typically have the highest auto insurance premiums?
    14·1 answer
  • What is a quick way to close the header or footer view in a microsoft word document?
    12·1 answer
  • All states that have altered judicial selection techniques in recent years have adopted some form of:
    5·1 answer
  • Which term describes the distance from one point on a wave to the same point on the next wave?
    13·2 answers
  • What are the advantages and disadvantages of the various collision resolution strategies for hashes?
    7·2 answers
  • What are the first letters of each of the 3 main colors in javaScript? (seperate with commas)
    9·1 answer
  • A. Get a value for x from the user.
    13·1 answer
  • It is possible to create a share that is invisible to users browsing the network simply by appending what character to the end o
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!