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]
3 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]3 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 skills used in video game play could be useful in scientific problem-solving games such as Foldit?
Sidana [21]
For the answer to the question above asking w<span>hat skills used in video game play could be useful in scientific problem-solving games such as Foldit?
Playing that game, it involves "critical thinking and puzzle solving skills. You need to solve </span><span>a protein-folding game like </span><span>unlock the structure of an AIDS-related enzyme.</span>
6 0
3 years ago
TRUE or FALSE: CSS is used to style web pages.
nirvana33 [79]

Answer:

true

Explanation:

HTML is the structure and CSS is the design

3 0
3 years ago
Why would a store owner want to calculate a mean
chubhunter [2.5K]

Answer:

a store owner would calculate a mean to see the how much a person spends

Explanation:

4 0
3 years ago
Ehred is a network technician for a hotel chain and has been notified that one of the locations is having issues with the guests
Ray Of Light [21]

Option a is correct. Captive portal issues is might best describe the issue occuring in this hotel.

Before newly connected users of a Wi-Fi or wired network are given full access to network resources, they are first shown a captive portal, which is a web page that can be accessed via a web browser. Authentication, payment, acceptance of an end-user license agreement, adherence to an acceptable usage policy, completing a survey, or other valid credentials that the host and user agree to abide by may be required when presenting a landing or log-in page through a captive portal.

Cable, commercially available Wi-Fi, and home hotspots are just a few of the mobile and pedestrian broadband providers that utilise captive portals. Access to residential or corporate wired networks, such as those in apartment buildings, hotel rooms, and business centers, can also be provided by a captive gateway.

To know more about captive portal click here:

brainly.com/question/14280680

#SPJ4

5 0
1 year ago
Read 2 more answers
Which presentation software element can you use to control the speed between slides in a presentation?
Ad libitum [116K]

The answer is the Transition element.

A slide transition in PowerPoint occurs when you move from one slide to another during a presentation. You can control the speed (time spend on a single slide before advancing to the next). We use set duration to set the transition speed. To set the transition speed to a shorter or a larger duration, select the slide and click on the Transitions tab in the Timing group. In the Duration box, type the number of seconds that you want.  


3 0
3 years ago
Read 2 more answers
Other questions:
  • Your company runs a commercial website that enables your business partners to purchase products and manage their accounts. You w
    9·1 answer
  • According to the Big Five Factors model, all but _____ are categories.
    11·1 answer
  • My internet works but my router won't let any devices connect to it unless you use a cat. 5 cable :\
    12·1 answer
  • Write code for iterative merge sort algorithm. It is also known as bottom-up merge sort. There should not be any recursive call
    14·1 answer
  • For a single CPU core system equipped wiith addditional hardware modes (besides user and kernel), choose those items that are ex
    7·1 answer
  • The base on which the number n=(34)? is written if it has a value of n= (22)10​
    6·1 answer
  • Write the following abbreviations in full next to the question number
    15·1 answer
  • The recipient list cannot be edited.<br> Group of answer choices<br><br> True<br><br> False
    5·1 answer
  • What method does a gsm network use to separate data on a channel?
    12·1 answer
  • based on your completed tables for ping requests and replies, which field do you think helps the network identify the appropriat
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!