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
If -3(y-1)=9 find the value of 1/2y
Sveta_85 [38]

Answer:

-1

Step-by-step explanation:

y-1=-3

y=-2

.:1/2y=1/2(-2)=-1

4 0
2 years ago
The length of a rectangle is 4 meters less then twice its width. the area of the rectangle is 70 meters squared. Find the width
Travka [436]

Answer:

yes es correcto ya que 70 es igual a 4 metros

8 0
3 years ago
Help plz!! Will give brainliest
r-ruslan [8.4K]

Answer:

C is the sorrect because those both lines are equal

Step-by-step explanation:

6 0
2 years ago
If the side length of a square pyramid is triple and the slant height is divided by 5 what would be the formula to find the modi
valentina_108 [34]
If the original side length is "s" and the original slant height is "h", the original surface area is
.. S = (base area) +(lateral area)
.. S = s² +(1/2)*(4s)*h
.. S = s(s +2h)

Now, if we make these replacements: s ⇒ 3s, h ⇒ h/5, we have
.. S' = (3s)(3s +2h/5)
.. S' = 9s² +(6/5)s*h . . . . . . . the formula for the modified area (in terms of original dimensions)

_____
Of course, in terms of the modified dimensions, the formula is the same:
.. S' = s'(s' +2h')
5 0
3 years ago
Which properties were used to solve the following problem?
Stels [109]

Step-by-step explanation:

25(2x) + 25(3y)

25 · (2 · x) + 25 · (3 · y)

(25 · 2) · x + (25 · 3) · y                <em>Associative property </em><em>(a · b) · c = a · (b · c)</em>

(25 · 2)x + (25 · 3)y

(2 · 25)x + (3 · 25)y             <em>Commutative property</em><em> a · b = b · a</em>

<em>50x + 75y</em>

5 0
3 years ago
Other questions:
  • A study found that 9% of dog owners brush their dog’s teeth. Of 578 dog owners, about how many would be expected to brush their
    7·1 answer
  • Please help! <br> I dont understand this and I need help with it.
    15·1 answer
  • 7 times as many as 9 is
    6·1 answer
  • What is the geometric mean of 6 and 7
    10·2 answers
  • What is the relationship between a and b. ?
    15·1 answer
  • 1.Which Measure correctly Completes the statement.
    6·1 answer
  • Given the function f(x) = log2(x + 6), find the value of f−1(3).
    6·2 answers
  • the scale of a map is 1 cm: 75 km what is the actual distance between two towns that are 3 cm apart on the map?
    5·2 answers
  • Which expression is equivalent to -2(5x -0.75)?
    11·1 answer
  • What type of
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!