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
qwelly [4]
4 years ago
14

Determine the distance between point (x1, y1) and point (x2, y2), and assign the result to points Distance. The calculation is:

Computers and Technology
1 answer:
Nadusha1986 [10]4 years ago
4 0

<u>Question:</u>

Snapshot of the question has been attached to this response.

<u>Answer:</u>

<u></u>

import java.util.Scanner;

import java.lang.Math;

public class CoordinateGeometry{

    public static void main(String []args){

       double x1 = 1.0;

       double y1 = 2.0;

       double x2 = 1.0;

       double y2 = 5.0;

       double pointsDistance = 0.0;

       

       //Declare a variable to hold the result of (x2 - x1)²

       double x;

       

       //Solve (x2 - x1)^2 and store result in the variable x

       x = Math.pow(x2 - x1, 2);

       

       //Declare a variable to hold the result of (y2 - y1)²

       double y;

       

       //Solve (y2 - y1)^2 and store result in the variable y

       y = Math.pow(y2 - y1, 2);

       

       //Now pointsDistance = SquareRootOf(x + y)

       pointsDistance = Math.sqrt(x + y);

       

       System.out.println("Points distance: ");

       System.out.println(pointsDistance);

       

       return;

    }

}

<u>Sample Output:</u>

Points distance:  

3.0

<u>Explanation:</u>

The above code has been written in Java and it contains comments explaining important lines of the code. Please go through the comments.

The snapshots of the program and a sample output have been attached to this response.

You might be interested in
After a user creates a new query or edits an existing query they must ________ the query to display the corresponding results.
kow [346]

It maybe they must run the query to display the corresponding results.

5 0
3 years ago
what is musical technology specifically, the origins of its genesis &amp; its importance to the baroque era
ki77a [65]

Answer:

There were three important features to Baroque music: a focus on upper and lower tones; a focus on layered melodies; an increase in orchestra size. Johann Sebastian Bach was better known in his day as an organist. George Frideric Handel wrote Messiah as a counterargument against the Catholic Church

3 0
3 years ago
What is a high level language?​
vovikov84 [41]

Answer:

a high level language is any programming language that enables development of a program in a much more user friendly programming context and is generally independent of the computers hardware architecture.

8 0
3 years ago
Read 2 more answers
What is the part of the browser window that displays the content of the web page such as pictures and text called?
iragen [17]
The frame is a part of the web page or browser window
5 0
3 years ago
Slide rule was the first mechanical calculator. true or false​
drek231 [11]

Answer:

False. Pascal's calculator was the first mechanical calculator invented by Blaise Pascal in the mid 17th century.

7 0
3 years ago
Read 2 more answers
Other questions:
  • What is best android apps​
    8·2 answers
  • When you use file explorer or windows explorer to delete a file from the hard drive, where does windows put the file?
    11·1 answer
  • You are the manager and two employees are having issues with each other. These issues are affecting their happiness and producti
    11·1 answer
  • Given the following sequence of integers: 12, 19, 10, 4, 23, 7, 45, 8, 15 Build a heap by inserting the above set, one integer a
    8·1 answer
  • The Michael Porter Diamond of National Advantage is a framework that explains why countries foster successful multinational corp
    11·1 answer
  • In the context of applications of artificial intelligence (AI), _____ perform well at simple, repetitive tasks and can be used t
    11·1 answer
  • Which of the following options is not located in the page setup dialog box?
    14·1 answer
  • 8.5 Edhesive Code Practice
    14·1 answer
  • Question 1 Which portion of the PuTTY package allows you to perform file transfers using the SCP (Secure Copy) protocol?
    12·1 answer
  • a good way to repeatedly perform an operation is to write the statements for the task once and then place the statements in a lo
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!