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
Has anyone taken the PERT? If so, what was it like? What was the math part like?
Hitman42 [59]

Answer:

guessed through it and made a 100 out of 150 pretty easy dude ( i'm only 14 so you can imagine how easy it is )

Step-by-step explanation:

7 0
3 years ago
Tania has 56 liters of milk. She uses the milk to make muffins and cakes. Each batch of muffin requires 7 liters of milk and eac
Sophie [7]
Equally divide 56 into 2 halves. 28 liters. 28 liters for muffins and 28 liters for cakes.
 
(muffins require 7 liters) 28÷7= 4
(cakes require 4 liters) 28÷4=7
x= 4 batches of muffins
y= 7 batches of cakes.
4 0
3 years ago
What is the solution to the system of equations?
Mashcka [7]
Answer: (-2, 5/3)

explanation: since you are given x = -2, just plug that into the equation and solve.
8 0
3 years ago
The formula for the volume V Of a cone has the radius r and the height h is shown below.
Allushta [10]

Answer:

H is same as h which means height if cone or perpendicular drawn from tip of cone to the base plane !

Hope this helps

3 0
3 years ago
Help me please ASAP!!!!
nydimaria [60]

Answer:

i need this too

Step-by-step explanation:

8 0
3 years ago
Read 2 more answers
Other questions:
  • Evaluate the expression when a=−15a=−15 and b=−5b=−5. b + 14a=
    5·1 answer
  • Simplify<br><br> square root of 3 multiplied by the fifth root of 3.
    13·2 answers
  • 72 kilograms equals how many pounds
    11·1 answer
  • F(x) = – 2x^2+ 6x + 1<br> Find f (6)
    8·1 answer
  • 15,7,7 can a triangle be formed?
    14·1 answer
  • What is its equation???
    9·2 answers
  • Rachel is setting up tables for a party. Four of the tables are covered with red tablecloths, and eight of the tables are covere
    14·1 answer
  • (GIVING BRAINLIEST!!)
    12·2 answers
  • GIVING BRAINLIEST!!!!!!
    5·1 answer
  • Solve the following equation:
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!