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
M. Section 4.1
vlabodo [156]

According to the given function, it is found that fewer than 38.1% of U.S. voters will use punch cards or lever machines starting from the year of 2004.

<h3>What is the function?</h3>

P(t) = -2.5t + 63.1

  • In which t is the number of years after 1994.

It will be fewer than 38.1% when:

P(t) < 38.1

Hence:

-2.5t + 63.1 < 38.1

-2.5t < -25

2.5t > 25

t > 10

Fewer than 38.1% of U.S. voters will use punch cards or lever machines starting from the year of 2004.

You can learn more about functions at brainly.com/question/25537936

7 0
2 years ago
The sum of two-thirds of a number and twenty
Ede4ka [16]

Answer:

2/3n + 20

Step-by-step explanation:

4 0
3 years ago
If it cost 4 tokens to park for 1 hour how many tokesns will it cost for to park for 22 hours
Andreyy89
It will cost 88 tokens to park for 22 hours because you will have to multiply the 4 by the 22 to get the 88 tokens so therefore the answer is 88 tokens
4 0
3 years ago
The radioisotope Mo-91 has a t1/2 of 15.5min. A sample decays at the rate of 954counts/min (954cpm). After how many minutes will
TiliK225 [7]

Step-by-step explanation:

Transcribed image text: Spectra Analysis 7 100 80 60 40 20 150 50 STRUCTURE 60 40 20 0 180 160 140 120 100 8O

5 0
3 years ago
Write mixed number for p so that 3 1/4 × p is more than 3 1/4
Sholpan [36]

Answer:

1 3/5

Step-by-step explanation:

Anything larger than 1 multiplied by 3 1/4 would result in a number more than 3 1/4.

8 0
3 years ago
Other questions:
  • You have a wire that is 71 cm long. You wish to cut it into two pieces. One piece will be bent into the shape of a square. The o
    7·1 answer
  • Simplify (-6y + 8y to the 4th power − 5)(y2 − 11y)
    7·2 answers
  • Does (3,6) is a solution to the promblem y&lt;3x-2
    15·2 answers
  • Standard form for 1x1+9x1/10+8x1/100+1x1/1000
    7·2 answers
  • Slope and the y-intercept for y=9x-9
    7·1 answer
  • Please - i got this wrong so plz help
    11·2 answers
  • What is the pythagorean thereom? And how is it used to solve triangles
    14·1 answer
  • 1+1(2)-5+96-4(67+9)+59+10
    6·1 answer
  • Solve the problem
    6·1 answer
  • Kelly Union works as a cashier and earns $12.75 per hour. Kelly worked
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!