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]
2 years ago
11

Write a program that does the following:

Computers and Technology
1 answer:
Nataly_w [17]2 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
What does gif stand for in computer terms?
SSSSS [86.1K]
<span>GIF stands for Graphics Interchange Format</span> which was released by CompuServe in 1987. The Graphics in GIF is why some people argue against it's originally intended pronunciation as "jif" (like the peanut butter) 
4 0
2 years ago
1.How can we be a responsible online user???​
PSYCHO15rus [73]

Answer:

Be respectful – and expect respect.

Protect your reputation.

Protect your privacy.

Watch your tone.

Be sceptical.

3 0
2 years ago
Read 2 more answers
Help me guys..<br>thankyou​
Rainbow [258]

Answer:

spoon

excess

level

1/2 cup

whatever dry ingredient u have

Explanation:

7 0
2 years ago
A(n) __________ is a common list operation used in programming. its purpose is to iterate through a list of items, one item at a
Nataliya [291]
I would say C- Priority List.
I hope this helps! :)
5 0
3 years ago
QUESTION 7
marishachu [46]
False, it needs to be properly cited because that is plagiarism which is illegal
6 0
3 years ago
Other questions:
  • HELP AS SOON IS A UNIT TEST WILL GIVE BRAINLIEST
    9·2 answers
  • A custom information field that helps users to find a specific document is called
    8·2 answers
  • How do I cancel a friend request?
    14·2 answers
  • What color is the smartart tolls tab?
    5·1 answer
  • What are the two types of formulas in excel
    9·1 answer
  • Read the excerpt from Act 111, scene iii of Romeo and Juliet. Which is the best paraphrase of this dialogue
    11·1 answer
  • Consider the following C program: int fun(int *i) { *i += 5; return 4; } 352 Chapter 7 Expressions and Assignment Statements voi
    11·1 answer
  • Item 8 Item 8 Shelby Black runs a very successful hair salon in downtown Los Angeles. One of Shelby’s tasks is to input positive
    13·1 answer
  • Dione has created a PowerPoint presentation that has several common nouns, names of products, etc. He is
    12·2 answers
  • Kahnacademy sucksi am so mad i want to k ..<br> ill myself
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!