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
Which image file format is an uncompressed raster file which may contain different depths of color depths per pixel, or may be s
dangina [55]

Answer:

BMP

Explanation:

The BMP file format, also known as bitmap image file, device independent bitmap (DIB) file format and bitmap, is a raster graphics image file format used to store bitmap digital images, independently of the display device (such as a graphics adapter), especially on Microsoft Windows[2] and OS/2[3] operating system

6 0
2 years ago
5. Which of the following could occur making it necessary for Amy to troubleshoot her computer? Error messages keep popping up,
sleet_krkn [62]

Answer:

Adding new hardware/Software

Explanation:

Depending on how much you add to your computer it could make it have too much, so it can work slower and make it malfunction therefore i would Troubleshoot for that reason.

3 0
3 years ago
When a visitor clicks the submit button on a form, the ______ of each form element is sent?
Bond [772]

In data presentation of computing systems and applications, when a user click the submit button on the form, the name-value pair of each form is sent because it is an open-ended data structure that allows future extension without altering existing code or data.

6 0
3 years ago
Read 2 more answers
What are the consequences of digital footprint ?
tekilochka [14]

Answer:

The digital footprint that is left behind can have repercussions in all areas of your teen's life, potentially resulting in missed job opportunities, public sharing of personal information, ruined relationships — or, in what is likely more relevant to them right now: Their parents finding out what they've been up to

Explanation:

8 0
2 years ago
Which of the following defines guidelines that specify the way computers access the medium to which they are attached, the type(
mart [117]

Answer:

network standard

Explanation:

4 0
3 years ago
Other questions:
  • Jason is creating a web page for his school's basketball team. He just finished creating his storyboard. Which tool should he us
    7·1 answer
  • How many bits are required to address a 1mx8 main memory if main memory is byte addressable?
    6·1 answer
  • Which of the following correctly describes the reason for quality customer service?
    15·2 answers
  • So I’m doing a PowerPoint of how social media changed my life any ideas what I should right down and what kind of topics should
    11·2 answers
  • What is encyclopedia. Com considered to be?
    14·1 answer
  • Peripeteia is also referred to as __________.
    5·2 answers
  • Here is the problem specification: An Internet service provider has three different subscription packages for its customers: Pac
    5·1 answer
  • We cannot imagine a life without the Internet. Imagine that you had to live without being connected to the Internet. Discuss the
    9·1 answer
  • Frrrrrrrrrrreeeeeeeeee brainliest for u
    13·2 answers
  • What is computer topology​
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!