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
Ira Lisetskai [31]
3 years ago
6

Create a new project called 02.03 Math Class Methods. Create a class called PyTheorem in the newly-created folder. Use the appro

priate Math class methods to calculate the hypotenuse of two right triangles. The value of each side (sides a and b) should be randomly generated using Math.random(). The range should from 5 (inclusive) to 23 (exclusive). Print the value of each side of both triangles as well as the value of the hypotenuse for both triangles.
Mathematics
1 answer:
SashulF [63]3 years ago
6 0

Answer:

The program in Java is as follows:

import java.util.*;

public class PyTheorem{

   public static void main(String [] args){

       Random rNum = new Random();

       int a = rNum.nextInt(17) + 5;

       int b = rNum.nextInt(17) + 5;

       System.out.println("a: "+a);

       System.out.println("b: "+b);

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

       System.out.print("Hypotenuse: "+hyp);

   }}

Step-by-step explanation:

This generates random number for a

       int a = rNum.nextInt(17) + 5;

This generates random number for b

       int b = rNum.nextInt(17) + 5;

Print a

       System.out.println("a: "+a);

Print b

       System.out.println("b: "+b);

Calculate the hypotenuse

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

Print the calculated hypotenuse

       System.out.print("Hypotenuse: "+hyp);

You might be interested in
The quadrilateral is a parallelogram. Find the measure of angles 1, 2 and 3
Vlad1618 [11]

Answer:

im pretty sure every angle is 80 degrees

Step-by-step explanation:

this is my first day in brainly, so im soo sorry if im wrong

4 0
3 years ago
Simplify -3d^8(-4d^-14). Assume d =/ 0​
Alenkinab [10]

Answer:

\frac{12}{d^6}

Step-by-step explanation:

-3d^8\left(-4d^{-14}\right)

Double negative = Positive:

3d^8*4d^{-14}

Apply negative exponent formula:

3*d^8*4*\frac{1}{d^{14}}

Multiply:

\frac{12d^8}{d^{14}}

Apply exponent rule: \frac{x^a}{x^b}=\frac{1}{x^{b-a}}

Thus, \frac{12}{d^{14-8}}

Simplify:

\frac{12}{d^6}

8 0
2 years ago
Simplify using the distributive property, Show all work -2(x - 5) + 4(9 + x).
zzz [600]
-2(x - 5) + 4(9 + x)
-2x + 10 + 36 + 4x
=2x + 46
7 0
3 years ago
What is the distance between the point (−10, −2)(−10, −2) and the point (−4, −2)(−4, −2) ?
Gnoma [55]
In this case:  x 1 = - 10,  y 1 = - 2;
x 2 = - 4 ,  y 2 = - 2
The distance between the points :
d =  \sqrt{(x 2 - x 1 ) ^{2} + ( y 2 - y 1 ) ^{2} } = \\  =\sqrt{(-4+10) ^{2} +(-2+2) ^{2} } = \\ = \sqrt{6 ^{2}+0 ^{2}  } = \sqrt{36}= 6
Answer: d = 6
4 0
3 years ago
Read 2 more answers
73 and 4.4 x 10 to the 6th power
Lubov Fominskaja [6]

Answer:

4,400,073

Step-by-step explanation:

Ez

8 0
3 years ago
Other questions:
  • How many solutions does this equation have ? <br>2(2x-1)=(x+1)+3(x-1)​
    8·1 answer
  • Freemont Run Club surveyed a random sample of 30 of their members about their running habits. Of the members surveyed, 9 said th
    10·2 answers
  • 8) A 10-foot ladder leans
    14·1 answer
  • A square photo display board is made up of 60 rows and 60 photos each. The area of each square photo is 4 in.². How long is each
    13·1 answer
  • What is the answer??
    11·1 answer
  • Find the missing side length, 28,25 and x
    5·1 answer
  • Which ordered pair (x, y) is a solution to given system of linear equations?
    7·1 answer
  • Do the side lengths of 8, 15, and 20 forms a triangle?
    14·2 answers
  • Elijah bought a new car for $25,000. He paid
    8·2 answers
  • What is the slope for the points (-1, 1) and (2, 3)?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!