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
Select the items below that are part of a cost-benefit analysis.
FromTheMoon [43]

Answer:

You dont have any items below, FYI

Explanation:

6 0
3 years ago
Suppose M=10, V=4, P= 10, Q = 5. What must be done to restore equilibrium? A. M & P must be reduced by 100% B. M must increa
Savatey [412]
Your answer would be D. Hope this helps
6 0
3 years ago
(a) Based on the data for the groups of cells cultured with 0.1% serum (groups 3 to 7), identify which of the four proteins test
kondaur [170]

Answer:

P 16

Explanation:

P 16 does not appear to play a role in blocking cell cycle entry by fibroblast. cyclin dependdent kinase (CDK) promotes cell cycle progression thus inhibitors of CDK inhibit cell cycle. In graph, it has been shown that in absence of p 16 there is no increase in DNA Content but when others are absent ,DNA CONTENT IS MORE.

6 0
3 years ago
In BD, BE=10x-3 and DE=8x-1
Anettt [7]

The figure is not marked in any way that would indicate it is a parallelogram. If we assume it is, then

... BE = DE

... 10x -3 = 8x -1 . . substitute the given expressions

... 2x = 2 . . . . . . . . add 3-8x

... x = 1 . . . . . . . . . . divide by 2

The appropriate choice is ...

... A. 1 unit

_____

Since the figure is not marked to indicate BE=DE, you could argue that any answer is correct.

6 0
3 years ago
RWBY MEEEMMEESSS :DDDDD
ozzi
Nice, thanks for the points.
7 0
2 years ago
Read 2 more answers
Other questions:
  • Edoardo is a fifth grader who will do or say just about anything to draw attention to himself in class. Determined to be in the
    6·2 answers
  • Write each sentence with one of these words:
    5·1 answer
  • What does the Federal Fair Housing Act of 1968 say?
    12·1 answer
  • 13. Which of the following does not apply to a market system? It ensures the availability of products that consumers want. It en
    7·2 answers
  • HELPPPPPPPPPPPPPPPPPPPPPPPP!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    8·2 answers
  • What does Lucy remember to do when she goes inside the wardrobe?
    7·1 answer
  • (With out plagiarism)
    13·1 answer
  • Need help plss geometry question
    11·1 answer
  • NEED AN ANSWER WILL GIVE BRAINLIEST
    9·2 answers
  • The area of a square can be modeled by the equation
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!