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
What is a Network It’s a system that is used to link two or more computers and name the different types of networks.?
mariarad [96]
Yes, that's correct. a network is where you connect two+ computers together.
5 0
3 years ago
Data administration is a special organizational function that manages the policies and procedures through which data can be mana
aleksandr82 [10.1K]
That is a true statement sir.
5 0
2 years ago
A spreadsheet is an interactive computer program used for
aksik [14]
Making charts, files that need complicated calculations
5 0
2 years ago
You work on the marketing team for a software company. You do not work closely with the development team; however, you need to k
topjm [15]

Answer:

b. an e-mail

Explanation:

Based on the scenario being described within the question it can be said that the best electronic communication tool in this scenario would be an e-mail. Using e-mails you would be able to send detailed communication messages to all of the individuals that need to read that message in one e-mail. Thus allowing for fast and clear communication between all relevant parties. Both podcasts and Wiki's are used for providing information to clients, or the target audience but not for sharing info within the company.

4 0
2 years ago
Which one bc im struggling
Setler79 [48]

Answer:

cant really see it

Explanation:

3 0
2 years ago
Other questions:
  • ¿Cuál es el objetivo principal de los servicios?
    7·1 answer
  • Nina aspires to be a digital media specialist. What should Nana be familiar with in order to pursue this career?
    9·2 answers
  • Suppose you have an int variable called number. What Java expression produces the second-to-last digit of the number (the 10s pl
    15·1 answer
  • One blog may have a greater social influence than another when it has_______?
    12·2 answers
  • When creating a chart or graph, which should be completed first?
    9·2 answers
  • Which of the following bit patterns represents the value -9 in two’s complement notation?
    15·1 answer
  • 50 POINTS!!!
    14·1 answer
  • What invention in the past do you think had a significant impact on our culture/ lifestyle? What do you think will be invented/
    11·1 answer
  • Explain the following buttons as used in emails:compose,inbox and Draft.<br>​
    10·1 answer
  • Do you guys answer questions about cyber security?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!