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
9 1/3+3(5)-10= Answer quick please
Vikki [24]
The answer is to your question is 5u1/3
6 0
2 years ago
Read 2 more answers
Derek has some Nickels and dimes worth $3.60 the number of dimes is one more than twice the number of nickels how many nickels a
tatiyna
5x + 10y = 360
y = 2x + 1

5x + 10*(2x + 1) = 360
5x + 20x + 10 = 360
25x = 350
x = 14

y = 2x + 1
y = 2*14 + 1
y = 29

Derek has 14 nickels and 29 dimes
5 0
3 years ago
Dustin and Janelle sold packs of trading cards to earn extra money before summer break. They sold each box for $51 which include
Grace [21]

Answer:

Dustin sold 28 packs

Step-by-step explanation:

3 0
2 years ago
PLEASE HELP ILL MARK BRAINLIEST<br> PUT THEM IN ORDER BY VALUE NOT BY NUMBER<br> BIDEN 2020
White raven [17]

Answer:

LCM for 3 and 6 - 6

GCF for 22 and 55 - 11

GCF for 26 and 65 - 13

GCF for 58 and 87 - 29

LCM for 9 and 12 - 36

LCM for 8 and 10 - 40

Hope this works better!

4 0
2 years ago
The cost of each ticket at the carnival was $0.25. Li bought $7.50 worth of tickets. How many tickets did she buy?
Drupady [299]
She bought 30 tickets. Just do 7.50 divide 0.25.
8 0
3 years ago
Other questions:
  • How do I solve this<br> Y= -8x+56<br> 2x+2y=56
    9·1 answer
  • What do you add too 17/4 to make 5
    8·1 answer
  • Which development would most likely cause the supply of a product to decrease?
    6·2 answers
  • 2•2•2•n•n using exponents. The product is?
    10·1 answer
  • HELP..
    11·1 answer
  • How do you solve this step by step?
    9·2 answers
  • (4,4) determaine whether each ordered pair is a solution of y=2x-4
    8·1 answer
  • Please answer correctly !!!! Will mark brainliest !!!!!!!!!!!!!!
    15·2 answers
  • 1.8= 2.1h-5.7-4.6h what is h
    8·2 answers
  • Choose the variable.<br> A 31 <br> B m
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!