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
borishaifa [10]
4 years ago
8

1. Add an import statement above the class declaration to make the Scanner class available to your program.

Computers and Technology
1 answer:
Mashutka [201]4 years ago
6 0

Answer:

import java.util.Scanner;

public class Assignment{

public static void main(String [] args)

{

Scanner input = new Scanner(System.in);

String firstName, lastName;

System.out.print("Firstname: ");

firstName = input.nextLine();

System.out.print("Lastname: ");

lastName = input.nextLine();

String fullName = firstName +" "+lastName;

System.out.print(fullName);

}

}

Explanation:

I'll use the line numbers in the question to point at the corresponding instruction

import java.util.Scanner; -- The import statement (1)

public class Assignment{

public static void main(String [] args)

{

Scanner input = new Scanner(System.in); -- Scanner object (2)

String firstName, lastName; -- Variable declarations

System.out.print("Firstname: "); ---- Prompt to enter first name (3)

firstName = input.nextLine(); --- User input for firstName (4)

System.out.print("Lastname: "); ---- Prompt to enter first name (5)

lastName = input.nextLine(); --- User input for lastName (6)

String fullName = firstName +" "+lastName; --- concatenating both user inputs (7)

System.out.print(fullName); --- Print out fullName (8)

}

}

You might be interested in
Which are types of lines? Choose three answers.
alekssr [168]
Straight
Curvilinear
Rectilinear
7 0
3 years ago
What is the danger in judging someone according to his or her social networking profile
AfilCa [17]
They could find you and throw hands.
8 0
3 years ago
What are the five steps of ethical hacking?
Paraphin [41]

Answer

Explanation:

Hacking is simply gaining access into a computer through weaknesses that were found in the network system.

We have mainly 5 stages In ethical hacking which although must not be followed sequentially but could produce greater results if it was followed.

These stages includes

1. Reconnaissance

2. Scanning

3. Gaining access

4. Maintaining access

5. Covering tracks.

8 0
4 years ago
You type a complex formula in cell A20. You would like to make the same calculation in cells B20 through H20. To be efficient, y
larisa86 [58]

Answer:

Use autofill

Explanation:

In excel "autofill" is used to fill data in cells, which follows the pattern or logic applied in other cells. To apply same calculation of A20 in B20 to H20, we use autofill technique. Instead of copy pasting, or manually entering the complex formula this method is more suitable.  

4 0
3 years ago
William has created a page view style sheet and saved it in a file named esd.css. What tags should William add to the document h
EleoNora [17]

Answer:

The answer is "<link href="esd.css" rel="stylesheet" />".

Explanation:

William will use the <link> tag because this tag is used to describe a connection between an external resource and an HTML file. In the <link> tag we use the href and rel attribute that is used to specify an anchor element target or destination and to define the current-linked file associate with.

  • This tag is an empty element, it contains only attributes.
  • The < link > tag is used to add existing style sheets.
  • The <link> tag also known as Singular Tag.
8 0
3 years ago
Other questions:
  • How can the connection to salesforce be restricted only to the employee portal server? Universal containers (UC) uses a legacy E
    13·1 answer
  • Which two things will you see when you collapse the view of the subdocument in a master document? (Microsoft Word)
    8·2 answers
  • Triggers are types of buttons seen in the input devices for which platform?
    14·1 answer
  • Use the drop-down menus to match each description to the correct term.
    13·2 answers
  • What goals do you set for yourself while studying?
    9·2 answers
  • What is the purpose of using variables in programming?
    11·1 answer
  • How does one award the brainliest???? will give brainliest.
    8·2 answers
  • What line of code makes the character pointer studentPointer point to the character variable userStudent?char userStudent = 'S';
    5·1 answer
  • Name the three major functions performed by the computer.
    6·1 answer
  • Q5: what is the difference between a spreadsheet and a relational database? when would you have to use a relational database ins
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!