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
Round 1,393 to the nearest thousand
myrzilka [38]
The answer is 1,000 4 or below you round down and 5 or higher you round up
6 0
3 years ago
Read 2 more answers
If h = 12 units and r = 4 units, what is the volume of the cone
rjkz [21]
The volume would be 201.06
4 0
3 years ago
Read 2 more answers
What is the mass of the shorter bar?
Lynna [10]
Its 24 kg , first you divide the 40 into 5 which equals 8 each so for each meter you get 8 kgs

so 8 multiplied by 3 is 24kg
4 0
3 years ago
Read 2 more answers
The numbers that satisfy the equation a =5.
madam [21]
<h2>Explanation:</h2>

We use an equation to say that two things are equal. An equation always has an equal sign "=". So an equation tells us that the left side is equal to the right side. In this case, we have the following equation:

a =5

So the only value that makes this equation to be true is 5, because:

5=5

For instance, let's choose another value, say, 8. So substituting:

6 =5 \ \text{So this statement is false because} \ 6\neq 5

5 0
3 years ago
15.1 m<br> 25.5 m<br> 35.7 m<br><br> FIND THE SURFACE AREA OF EACH RECTANGULAR PRISM
bezimeni [28]
Oooooooooooooooooooowqqqqqqqqqqqqqqqqqqqqdddqqqqqqqqqhujkuz 

5 0
3 years ago
Other questions:
  • I have another Brainliest
    6·2 answers
  • How do I combine like terms
    12·1 answer
  • Four times the sum of x and 6 is equal to 32.<br> what is the algebraic expression?
    6·1 answer
  • PLEASE HELP ME I WILL MAKE YOU BRAINILIST
    5·1 answer
  • (y − 3)^2 = 4(x − 5), (6, 1). Find an equation of the tangent line to the graph at the given point.
    5·1 answer
  • A circle has a circumference of
    5·1 answer
  • Find the sum of the first 7 terms of the following series, to the nearest integer. 125,50,20,...
    9·1 answer
  • PLEASE HELP TIMED<br> FIND SURFACE AREA<br> 10m<br> 10m<br> 6m 8m
    14·1 answer
  • 4x - y + 7x y<br><br> simplfy the expression
    10·1 answer
  • 4. A plumber charges $25 for a service call plus $50 per hour of service. Write an equation in slope-intercept form for the cost
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!