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
3 thing I learned in ICT
frutty [35]
I’ve learned makes me understand how it is important in our life to have an internet, and also important to know as a things I’ve known. First of all, I have learned about Camtasia, it is a program that are used to make a video about. And to show the others that how to do this or that on the computer.
6 0
3 years ago
Balance is the design principle that is represented when using the Crop tool?
RUDIKE [14]

Answer:

The answer is "False".

Explanation:

The rule of thirds implies to the subject, which is not centered mostly on the picture because of new photography formats their shots. Its main object is a little off with one side by using a third-party principle, which draws your attention for the audience into another design, instead of only looking at the center. In another word, we can say that this rule is used as the definition to design the Crop tool to represent as an overlay.

8 0
3 years ago
How many days has trump been a president
Free_Kalibri [48]
Hey there
_______________
The correct answer is
1 year, 64 days, 13 hours, 11 minutes and 44 seconds

__________
Hope this helps you
8 0
3 years ago
Read 2 more answers
Which feature of a website takes you to a different part of the website or a totally different website when you click on it?
lesantik [10]

A hyperlink is a feature that takes you to a different page when you click on it. That page could be part of the same website or a totally different website.

Let me know if you have any questions.

3 0
3 years ago
Read 2 more answers
When computers are connected and operate through one main computer, it is called a _________ network
adoni [48]
It might be a LAN or Host network. I'm not sure about your question, but your answer might reside in your notes for this class. 
6 0
3 years ago
Read 2 more answers
Other questions:
  • Creating calendar events prevents individuals from being able to schedule a time to collaborate.
    11·1 answer
  • If you don't know whether to write too, two, or to, you should use the spell-checker to help you decide. true or false?
    7·1 answer
  • Membrane-bound organelles are not found in the cells of A) bacteria. B) fungi. C) plants. Eliminate D) protists.
    15·2 answers
  • Universal Containers has a requirement to integrate Salesforce with an external system to control record access. What option sho
    11·1 answer
  • Write the header file Stadium.h for a Stadium class. The Stadium class has the following data members: 1) an array of 1000 Seat
    7·1 answer
  • Which of these is NOT a mathematical operator used in Python?
    12·1 answer
  • Which statement describing the arcade games played in the 1970s is true?
    14·1 answer
  • You are a network administrator for your company. The network consists of a single Active Directory domain. All servers run Wind
    7·1 answer
  • What is the engine for<br> ?
    6·2 answers
  • a customer receives a message from the bank asking him/her to provide login information. assuming the message is intended to def
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!