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
Troyanec [42]
2 years ago
8

Copy the skeleton of code below into your answer. Then in the space indicated, add your own code to prompt the user for two numb

ers and a string and then prints the difference of those numbers with a message to the user (text in bold is input entered by the user). Note that the final output should be on a line by itself. Recall that the difference of two numbers is found by subtracting the second number from the first.
Enter the first: 10
Enter the second: 3
Enter your name: Dinah Drake
Dinah Drake, the difference is 7
Computers and Technology
1 answer:
ahrayia [7]2 years ago
7 0

Answer:

import java.util.*;

public class Main

{

public static void main(String[] args) {

    Scanner input = new Scanner(System.in);

   

 System.out.print("Enter the first: ");

 int first = input.nextInt();

 System.out.print("Enter the second: ");

 int second = input.nextInt();

 input.nextLine();

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

 String name = input.nextLine();

 

 int difference = Math.abs(second - first);

 

 System.out.println(name + ", the difference is " + difference);

}

}

Explanation:

*The code is in Java.

Create a Scanner object to get input from the user

Ask the user to enter the first, second, and name

Calculate the difference, subtract the second from the first and then get the absolute value of the result by using Math.abs() method

Print the name and the difference as in required format

You might be interested in
Next, let's examine what happens when you apply a style to an element that contains other elements. The body element in the HTML
CaHeK987 [17]

Answer:

When the body element CSS color style was changed, The color of all the text in the HTML file changed to the specified color, the same goes for font-size, font-weight, etc.

Explanation:

HTML or hypertext markup language is a markup language used in web development to implement the position and structure of the web page. It has no style, so, CSS or cascading style sheet is used to style the HTML elements in the web page.

4 0
2 years ago
The Twitter website has become a de facto first source for many important events in the last decade. Twitter's hashtag feature l
timurjin [86]

Answer:

..........................................?

7 0
3 years ago
Read 2 more answers
Manufacturing product designs must be tested before they are put into production. Who is responsible for this?
hammer [34]

For testing the designs of the product prior to putting it into production, mechanics should be responsible for the same.

The information related to the mechanics engineers is as follows:

  • They are responsible for manufacturing & designing of machines & products.
  • It is the engineering branch.
  • Moreover, they are fully responsible for developing things.

Thus we can say that for testing the designs of the product prior to putting it into production, mechanics should be responsible for the same.

Learn more related to the production here: brainly.com/question/22852400

4 0
3 years ago
Lin is creating a template for the configuration of Windows servers in her organization. The configuration includes the basic se
larisa86 [58]

The type of document should she create is  baseline document. Check more about the term Baseline below.

<h3>What is a Baseline document?</h3>

A Baseline document is known to be a kind official or legalized document that has passed through some measures of start approval and was used for its purpose.

Note that for Lin to be able to make the template for the configuration of Windows servers, the type of document that she can create is  baseline document.

Learn more about Windows servers  from

brainly.com/question/14526761

#SJ1

3 0
2 years ago
How do you clear space in your iCloud?
Oxana [17]
Reset your settings and all storage by using your computer or device filter
6 0
3 years ago
Other questions:
  • What might be the best response to a cyberbuly attack
    6·2 answers
  • What inventor patented the first American movie projector?
    14·2 answers
  • What determines how large the crystals in an igneous rock will be?
    15·2 answers
  • A network monitor records the following information while recording a network connection.
    9·1 answer
  • Password combined with pin used as an authentication requirement is an example of:
    6·1 answer
  • Describe how mendeleev organized the elements into rows and columns in his periodic table.
    12·1 answer
  • Please list ten things that you have learned an Excel Spreadsheet can do.
    7·1 answer
  • A previously saved labels report can be accessed from the
    9·1 answer
  • What is the importance of human flourishing to science and technology?​
    8·1 answer
  • LAB: Parsing dates Complete main() to read dates from input, one date per line. Each date's format must be as follows: March 1,
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!