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
Please help fast!! help me solve this math problem
Digiron [165]

Answer:

<u>B</u> because if you divide each fraction you get 8.7.

7 0
3 years ago
PLEASE HELP!!! Which equation is relevant to 4^x^+^3=64
Aleksandr [31]

I believe it’s the second option 2^2x+6=2^6

6 0
3 years ago
Read 2 more answers
1) Find the value for a that makes sin a = cos 25 true A ) 35 B) 65 D ) 155
svet-max [94.6K]

Answer:

B

Step-by-step explanation:

Using the cofunction identity

sin(90 - x)° = cosx°

Here x = 25° , then

cos25° = sin(90 - 25)° = sin65°

6 0
2 years ago
How do I find the equation for a line?
Butoxors [25]

Answer:

The equation of a line is typically written as y=mx+b where m is the slope and b is the y-intercept.

Step-by-step explanation:

4 0
3 years ago
Read 2 more answers
Can someone please help me
jenyasd209 [6]
DONT CLICK THE LINK BAE ITS A VIRUS
3 0
3 years ago
Other questions:
  • Which of the following could not be a value of x?<br> a -10<br> b-9<br> c-10.5<br> d-9.5
    6·1 answer
  • On a coordinate plane, point A is located at (7, 4), and point B is located at (-8, 4). What is the distance between the two poi
    8·2 answers
  • Joan buys cans of beans in bulk. She buys 3 cases of beans for a total of $23.15. Each case contains 6 cans of beans. Complete e
    5·1 answer
  • Identify whether the figure has plane symmetry, symmetry about an axis, or neither. HELP ASAP!!
    6·1 answer
  • What’s the surface area of these<br><br> Only 10 minutes to answer
    6·1 answer
  • WILL MARK BRAINLIEST PLS HELP
    15·1 answer
  • 15 people are sharing $482 fairly between them. How many dollars should each person take?
    8·1 answer
  • Robert runs 3 times a week for 12 weeks. Each run is 4 miles. How many total miles will he run during 12 weeks?
    6·1 answer
  • How do I find the function rule???<br> x: 0, 1, 2, 3<br> y: 5, 4, 3, 2
    13·1 answer
  • Help me please ASAP !
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!