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
A. acute; 45<br> B. Acute; 55 <br> C. Obtuse; 135<br> D. Obtuse; 45
xxMikexx [17]
It’s A, if you add 70 and 65 you get 135 and 180-135=45 :)
6 0
3 years ago
Molly has $500 in her savings account. She owes her parents $100 for a new outfit. She also owes her brother $25. What is her cu
Inessa [10]

Answer:  His net worth is $375

Step-by-step explanation:

Since, Net worth = Total assets - total liabilities

And, here the total assets of Molly = the money she has in her saving account

= $500

Also, according to the question,

She owes her parents $100 and her brother $25.

Therefore, total liability of her = 100 + 25 = $125

Thus, Her net worth=  500 - 125 = $375

3 0
3 years ago
PLEASE HELP <br> I just wanna be done with this
charle [14.2K]

Step-by-step explanation:

The amount of times you roll the dice x 10 = answer

8 0
3 years ago
Pretty please help
beks73 [17]

how many solutions do intersecting lines have? - 0,1 or infinitely many

how many solutions do parallel lines have? - 0 or infinitely many

if you are looking at a graph and trying to find a solution what are you looking for? - for the point(s) when the graphs intersect

7 0
3 years ago
Which expression represents five more than one-third y?
MaRussiya [10]

Answer:

1/3 y  +5

Step-by-step explanation:

five more than one-third y

1/3 y  +5

5 0
3 years ago
Read 2 more answers
Other questions:
  • Dale needs to drive a total of 23 miles. So far, he has driven 7.2 miles. How many more miles must Dale drive?
    7·1 answer
  • Please help me to prove this!​
    9·1 answer
  • What is the area of the triangle 10 13 12
    6·1 answer
  • What is 51-38=8 and 44-38=8?
    10·1 answer
  • At the market, 8 apples cost $4.How much do 9 apples cost?
    15·2 answers
  • ΔABC is similar to ΔMNO. The scale factor from ΔMNO to ΔABC is 3∕2 . If the area of ΔMNO is 10 square units, what's the area of
    12·1 answer
  • What fraction of a given sample of radioactive nuclide remains after four half lives?
    12·2 answers
  • What is the value of 4 x 3 divided by (12 divided by2)^2
    14·2 answers
  • Anna is selling boxes of chocolate chip cookies (c) for $6 each and boxes of peanut butter cookies (b) for $7 each. She must
    12·1 answer
  • Help please thank you
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!