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
Graph 9x+6y=-12 please
sasho [114]

Answer:

Attached

Step-by-step explanation:

5 0
3 years ago
Solve the inequality for x. <br> 3<br> 2<br> x + 2 &gt; 32
Elden [556K]

Answer:

x > 30

Step-by-step explanation:

x + 2 > 32

Subtract 2 from each side

x + 2-2 > 32-2

x > 30

4 0
3 years ago
Read 2 more answers
Solve the blank: This equation for this graph is y=____x + _______​
Marysya12 [62]

Answer:

y=3x+2

Step-by-step explanation:

3 0
3 years ago
How to graph quadratic equations
icang [17]
If you are graphing quadratic equations of the type
ax^2 + bx + c = 0

The equation will look like a "U" <span>if "a" is positive </span>or it will look like an upside-down "U" <span>if "a" is negative </span>


6 0
4 years ago
Does anyone know the answer???
Fiesta28 [93]

Answer:

-2

Step-by-step explanation:

41 - 8m - 57 = 0

41- 8m = 57

-8m = 57-41

-8m = 16

m = -16/8

m = -2

8 0
3 years ago
Read 2 more answers
Other questions:
  • Each wheel of Gia's bicycle is 24 inches in diameter. Gia rides her bike 1,884 feet. To
    6·1 answer
  • Male | Female
    6·2 answers
  • At the Kennel, the ratio of dogs to cats is 3:1. If there are 12 dogs, how many cats are there?
    9·1 answer
  • How can the name of a prism or a pyramid help you visualize the cross sections of the solid?
    15·2 answers
  • Iris charges a fee for her consulting services plus an hourly rate that is 15 1times her fee. On a 7-hour job, Iris charged $470
    10·1 answer
  • Isolate the variable for x/5=7.5<br> 1 x=35<br> 2 x=1.5<br> 3 x= 37.5<br> 4 x= 2.5
    13·1 answer
  • What​ polynomial, when divided by 7y^3, yields 3y^2-4y+7 as a quotient?
    9·1 answer
  • A delivery truck drove 48 miles per hour. It took 4 hours to travel between two towns. What is the distance between the two town
    10·2 answers
  • Simplify this expression. Show your work. (7x - 5) - (3x - 2)​
    6·1 answer
  • An inequality is shown.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!