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
Solve for x: −2(x + 3) = −2(x + 1) − 4. (1 point)
NeTakaya

Answer:

Hey there!

Let's solve our equation below.

-2(x+3)= -2(x+1)-4

Let's distribute the parentheses.

-2x-6=-2x-2-4

We combine like terms.

-2x-6=-2x-6

We add 6 to both sides.

-2x=-2x

We divide both sides by -2

x=x

If, when solving an equation, you get one number or variable that equals itself, there are infinitely many solutions.

We can plug anything into this equation and it will always equal to same things, since x is just equal to whatever x value you want.

Therefore, there are infinitely many solutions.

I hope this helps!

8 0
3 years ago
A worm is at the bottom of a 10-foot wall. Every day the worm crawls up 3 feet, but at night it slips down 2 feet. How many days
Gelneren [198K]
It will be 13 days........................
8 0
4 years ago
10:5 is equivalent to ?:8
Maru [420]

Answer:

?=16

Step-by-step explanation:

can't really explain this but I'm sure its right

6 0
3 years ago
The 6 elephants at the zoo have a combined weight of 11,894 pounds. About how much does each elephant weigh?
Alisiya [41]

Answer:

1982.33 pounds

Step-by-step explanation:

If they all weigh the same amount then you can figure it out by division.

11894/6=1982.33

3 0
3 years ago
Read 2 more answers
PLS HELP ITS URGENT!!
suter [353]
2(pi)r = 9.4in
(pi)r = 4.7in
3.14r = 4.7in
r = 1.497in

Surface Area Of a Sphere = 4(pi)r^2 = [4(3.14)(1.497)^2]in^2 = 28.147in^2 = 28in^2
Volume Of a Sphere = 4/3(pi)r^3 = [4/3(3.14)(1.497)^3]in^3 =14.05in^3 = 14in^3
5 0
2 years ago
Other questions:
  • <img src="https://tex.z-dn.net/?f=c%3D%202%5Cpi%20r" id="TexFormula1" title="c= 2\pi r" alt="c= 2\pi r" align="absmiddle" class=
    6·1 answer
  • for the graph, complete the following (a) write a table of ordered pairs from the graph. (b) write an equation from the table. (
    7·1 answer
  • Rowan has 50$ in a saving jar and is putting in 5$ every week. Jonah has 10$ in his own jar is putting 15$ very week. Each of th
    6·1 answer
  • Circle the quadrilaterals that have all the attributes one rectangle? Trapezoid, parallogram, square, rhombus
    6·2 answers
  • What is domain and range
    14·2 answers
  • The circumference of a circle is 29x inches. Find the radius.
    11·1 answer
  • You lean a 30 foot ladder against your house and it reaches exactly to the top. The ladder makes a 24 degree angle with the grou
    8·1 answer
  • 22% of the customers visiting the suit department of a certain store will purchase a suit, 30% will purchase a shirt and 28% wil
    6·1 answer
  • Please help lol easy math
    8·2 answers
  • Solve for x. Enter the solutions from least to greatest. 6x^2 +1 =487 lesser=x greater=x
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!