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
You often travel away from the office. While traveling, you would like to use a modem on your laptop computer to connect directl
34kurt

Answer:

The answer is "Remote access "

Explanation:

The capacity to access another computer or network that you do not have. Remote computer access provides an employee with remote access to the desktop and file. This assists an employee, for example, who works at home efficiently.

Remote users access documents or other resources on any network-connected device or server, enhancing organizational efficiency and increase there are to cooperate more interact with peers nation.

6 0
3 years ago
I need help with this​
Elodia [21]
The answer is number 2.
8 0
3 years ago
How does the medium affect the amplitude of sound?
Ratling [72]

The amplitude of a sound energy depends upon the how much energy we are giving to the wave or how much compression on the wave is taking place.

It does’t depends upon the wave length,frequency


7 0
3 years ago
Which statement is true about the filtering technique? A. You cannot apply multiple filters. B. You cannot remove a filter once
Naily [24]

Answer:

<u>C. You cannot unhide rows by removing filters</u> is the correct statement about filtering technique.

Explanation:

We can apply multiple filters for rows or columns. If we would like to view the data satisfying multiple filters, this option can be used.

Once a filter is applied, it can be removed or added again. The hidden rows or columns will be visible once all the filters are removed. By building a selection list of all the rows that should not be visible, we can hide the rows by removing filters.  

Filters can be applied to any row or column.

5 0
3 years ago
Required
soldier1979 [14.2K]

Answer:

Declined sitting

Explanation:

You need to have a lot of abs to do that position so naturally it is not a neutral position. Hope I helped!

3 0
3 years ago
Other questions:
  • To reduce inflation, the Federal Reserve _____ the money supply. This action also causes the economy to shrink.
    13·2 answers
  • Which of the following programs can open a bitmap file?
    11·2 answers
  • Write a method called printRange that accepts two integers as arguments and prints the sequence of numbers between the two argum
    6·1 answer
  • Write a series of conditional tests. Print a statement describing each test and your prediction for the results of each test. Fo
    5·1 answer
  • Your company has a wireless network for its small office network. The wireless network does not broadcast its service set identi
    11·1 answer
  • It is important for security practitioners to take into consideration the __________ element when devising password security pol
    15·1 answer
  • Steps in the systems development life cycle​
    15·2 answers
  • When comparing different biometric systems, one of the most important metrics used is called the _________, which represents the
    14·1 answer
  • What happens to a message when it is deleted?
    5·2 answers
  • nts/viewer/classes/289ef1a5d7c341c284010 Select the compound inequality shown on the graph. 5 4 3 2 1 0 1 2 를 4​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!