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
HELP ME PLEASE!!!<br> Find the area of the triangle shown below.
Jlenok [28]

Answer:

Sorry I don't know

Step-by-step explanation:

7 0
3 years ago
Read 2 more answers
Z² + 2z+1-w²<br><br> Please factor.
Rus_ich [418]
Your answer is (z+1+w) (z+1-w)
3 0
3 years ago
Does anyone know what lesson this is i took these notes are they good
Nezavi [6.7K]

Answer:

ngl i learned this type of math pretty sure, and that looks better than my teachers own notes-

Step-by-step explanation:

ima go poof again cuz if i don't ima lose my game ;-;

7 0
3 years ago
Read 2 more answers
Find the value of x<br> 12<br> 36<br> 18<br> 24<br> 27<br> 36<br> 0 11<br> 9<br> 0 10<br> 012
vazorg [7]

Answer:

11

Step-by-step explanation:

I think if I am wrong I am sorry

7 0
3 years ago
If sin yº = 7/q and tan yº = 7/r , what is the value of cos yº? (6 points)
olya-2409 [2.1K]

Answer:

cos r/q is the answer,

Step-by-step explanation:

this can be seen when you elaborate sin=opposite/hypotenus and tan=opposite/adjacent by referring to the right angle triangle .

then, apply values of adjacent dan hypotenuse to cos

4 0
3 years ago
Other questions:
  • Hera spent $16 on dinner. Then she spent S6 on dessert and some more on a taxi ride. Including the taxi fare, she spent a total
    12·1 answer
  • 4 7/12 - 2 1/6 simplified
    12·2 answers
  • Sally is trying to decide what to wear to school. She has 5 pairs of pants, 10 shirts, and 3 pairs of shoes. Assuming everything
    8·1 answer
  • A seamstress has 5.2 feet of ribbon. How many 6/10 feet strips of ribbon can she cut?
    8·1 answer
  • the area of a rectangle is given by the equation y=x^2-9x+14 and the length of the rectangle is x-2. which of the following expr
    10·1 answer
  • P(x&lt;40)= find the answer
    6·1 answer
  • Someone please help thank you
    13·2 answers
  • Given the equation A=250(1.1)t, you can determine that the interest is compounded annually and the interest rate is 10%. Suppose
    15·1 answer
  • In the ordered pair (2, 3), what is the x-coordinate? y-coordinate?
    15·2 answers
  • Write the quadratic equation that has roots (-1-√2)/3 and (-1+√2)/3 , if it's coefficient with x^2 is equal to
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!