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
rosijanka [135]
3 years ago
8

Two lights will be arranged on a two-dimensional plane. The vertical distance between the two lights is stored in the double var

iable a. The
horizontal distance between the two lights is stored in the double variable b.

The straight-line distance between the two lights is given by the formula

ſa² +b²

Write a code segment that prints the straight-line distance between the two lights according to the formula above.
Advanced Placement (AP)
1 answer:
lbvjy [14]3 years ago
6 0

Answer:

double a;

double b;

double distance = Math.sqrt( (Math.pow(a, 2) + Math.pow(b, 2));

System.out.println("The distance is: " + distance);

Explanation:

The code snippet is written in Java.

First, variable a is declared as a type of double and variable b is also declared as a type of double.

The given formula for the distance is:

√(a² + b²)

So we use the inbuilt function of Java to calculate the power and the square root.

Math.sqrt is to find the square root and it returns a value of type double.

Math.pow is use to calculate the value of a² and b².

a² = Math.pow(a, 2)

b² = Math.pow(b, 2)

Then Math.sqrt is applied to the sum of Math.pow(a, 2) and Math.pow(b, 2), the value is assigned to distance of type double.

The value of distance is now displayed to the user:

System.out.println("The distance is: " + distance);

You might be interested in
A comprehensive study of more than 3,000 baseball games in the graph below showing relative frequencies of runs scored by home t
ANTONII [103]

Answer:

The correct answer is the Mean is greater than the median value if X.

Explanation:

Solution

From the question given, we will find out which is greater between the mean and median

Now,

The median value of X is less than the mean.

For a right skewed distribution the mean is greater than a median. it can be seen that the distribution the distribution of X is right  positively/skewed/ or X has a longer right tail.

Note: Kindly find an attached copy of the complete question given.

I solved just a part of the question given here.

4 0
3 years ago
A program in which students learn a specific skill for a particular job is called<br> a(n):
Anna71 [15]
A certification program.
4 0
3 years ago
If the Civil War had begun as a war to restore the Union, how did this Proclamation changed the purpose of the war?
OlgaM077 [116]
The Proclamation changed the purpose of the war into one of freeing slaves completely, making the long war into one about wether or not slavery would remain in place . The South claiming that they needed slaves to work on their plantations and needed slaves to help around was a major part of the war . They wanted to continue on this racist act of holding “different” people under their feet. Many say now that the this was not a reason for the war nor the separation between the north and south but when looking back at every statement made by every southern state slavery is mentioned for their uprising .
7 0
3 years ago
Pintados naman ang tawag sa mga taong ayaw manatili sa isang lugar para mamuhay.
ankoles [38]

Answer:

A. Tama

Explanation:

Hindi ko po sure kung tama

6 0
2 years ago
At the singularity, which one of these are NOT infinite?
rodikova [14]
Escape velocity, stillness is possible
7 0
4 years ago
Other questions:
  • A(n) ______close to a cover letter leads to more interviews because you are contacting the employer.
    9·1 answer
  • 1. You and your classmates are divided into four groups that govern your entire school. Each group has a different function but
    6·1 answer
  • Which instrument sends back radio signals to Earth about temperature at various heights in the atmosphere? A. weather balloon B.
    14·2 answers
  • In short-answer format, write a brief response to the following prompt:If most Americans have a generally unfavorable view of co
    12·1 answer
  • My Brother is just hearing about this app he asks what are ya'lls fav animals
    11·2 answers
  • True or false, if false please state the correct answer
    9·1 answer
  • What did the central place theory teach?
    15·1 answer
  • Dr. Whitlock is conducting an experimental study on the effectiveness of antipsychotic medication Which of the following will mo
    9·1 answer
  • Prompt: A shared sense of shame is important for keeping society healthy.
    9·2 answers
  • ¿que es el individuo y el grupo en psicologia?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!