Create a new project called 02.03 Math Class Methods. Create a class called PyTheorem in the newly-created folder. Use the appropriate 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.

Answers

Answer 1

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);


Related Questions

Question
Find the equation of the line which has slope 7 and y-intercept 2. Give your answer in the form y = mx + b.
Provide your answer below
Im not to sure on this problem

Answers

Answer:

y=7x+2

Step-by-step explanation:

In this form of an equation (y=mx+b), m is the slope of the line and b is the y-intercept.

So, since the slope (m) is 7 and the y-intercept (b) is 2, the equation is:

y=7x+2

Which of the following can be constructed by drawing an angle on tracing
paper and then folding the paper so that the rays forming the angle lie upon
each other?
A. Parallel lines
• B. Angle bisector
• C. Median of a line segment

D. Perpendicular line segment

Answers

B. angle bisector.

i hope this helps

One hundred sixty people were surveyed and asked if believed in ufos, ghosts, and bigfoot. 42 believed in ufos 45 believed in ghosts 21 believed in bigfoot 11 believed in ufos and ghosts 6 believed in ghosts and bigfoot 4 believed in ufos and bigfoot 2 believed in all three how many people surveyed believed in at least one of these ?

Answers

Answer:

[tex]P(A\cup B \cup C)=89[/tex]

Step-by-step explanation:

From the question we are told that:

Believed in UFO's [tex]A=42[/tex]

Believed in Ghosts [tex]B=45[/tex]

Believed in Bigfoot [tex]C=21[/tex]

Believed in UFO's & Ghosts [tex]A&B=11[/tex]

Believed in Ghosts & Bigfoot [tex]B&C=6[/tex]

Believed in UFO's & Bigfoot [tex]A&B=4[/tex]

Believed in ALL [tex]A&B&C=2[/tex]

Generally with a well detailed Set diagram of the Number of People that that believed in at least one of them is mathematically given by

 [tex]P(A\cup B \cup C)=n(A\cap C)-n(B\cap C) +n(A\cap B \cap C)[/tex]

 [tex]P(A\cup B \cup C)=42+45+21-11-6-4+2[/tex]

 [tex]P(A\cup B \cup C)=89[/tex]

What is the sum of 4th squared number and the 2nd cube number

Answers

Answer:

mark me as brinalist if answers are correct

The answer above is correct!

Identify an equation in point-slope from for the line perpendicular to y=-4x-1 that passes through (-2, 4)​

Answers

Answer:

y - 4 = ¼(x + 2)

Step-by-step explanation:

Point-slope form equation is given as y - b = m(x - a). Where,

(a, b) = a point on the line = (-2, 4)

m = slope = ¼ (sleep of the line perpendicular to y = -4x - 1 is the negative reciprocal of its slope value, -4 which is ¼)

✔️To write the equation, substitute (a, b) = (-2, 4), and m = ¼ into the point-slope equation, y - b = m(x - a).

y - 4 = ¼(x - (-2))

y - 4 = ¼(x + 2)

None of the options are correct

help me with this please pleaseee!

Answers

Answer:

2

Step-by-step explanation:

Since the two rectangles are similar, the ratio of their similar sides will be a constant k

Hence;

18/9 = 12/6 = k

Since they are all the same, then;

k = 18/9

k = 2

Hence the scale factor is 2

Answer:

D. 1/2

Step-by-step explanation:

The scale factor is the ratio of corresponding sides:

k = 9/18 = 1/2

or

k = 6/12 = 1/2

Correct choice is D



A full glass of water can hold 1/6 of a bottle.
How many glasses of water can be filled with 3 bottles of water

Answers

that is 21 glassesssssssss
1 full glass = 1/6
x= 3

➡️1/6 * x = 3

➡️ x/6 = 3

➡️ x = 6 * 3

➡️ x = 18

Raju and Johari baked 143 muffins altogether. Andrew and Johari baked 211 muffins altogether. (b) If Andrew baked 113 muffins, how many muffins did Raju, Johari and Andrew bake altogether?​

Answers

Answer:

467 muffins

Step-by-step explanation:

143 + 211 + 113 = 467

We have the number of emergency room admissions to SWTRHA hospital on 6 different Friday the 13ths along with the number of admissions to the same hospital on the previous Friday the 6th. Is there any difference between admissions on the 6th and the 13th. Conduct a depedent samples t-test to find out. What is the value of your t Stat

Answers

Answer:

Test statistic = - 2.71

Step-by-step explanation:

Table of the sample data is attached below :

Using a dependent sample t test :

H0 : μd = 0

H0 : μd ≠ 0

The difference in the 6th and 13th date data is :

Difference, d = -4, -6, -3, -1, 1, -7

The sample size, n = 6

The mean of d ; μd = Σd/ n = - 3.667

Standard deviation of difference, Sd = 3.011

The test statistic : μd/(Sd/√n)

Test statistic = - 3.33 / (3.011/√6)

Test statistic = - 3.33 / 1.2292356

Test statistic = - 2.709

Test statistic = - 2.71

When 50% of a number is added to the number, the results is 165

Answers

Answer:

this would look like

0.5x+x=165

1.5x=165

x=110

Hope This Helps!!!

in an examination 30% of the candidates failed in English and 35% failed in general studies and 27% failed in both subjects.if310 candidates passed in both how many candidates appeared in the examination​

Answers

Answer:

500

Step-by-step explanation:

Help me write this as an absolute value function!

Answers

Answer:13

Step-by-step explanation:11

identify an equation in slope-intercept form for the line parallel to y=-3x+7 that passes through (2,-4)

Answers

Answer:

y = -3x + 2

Step-by-step explanation:

If two lines are parallel to each other, they have the same slope.

The first line is y = -3x + 7. Its slope is -3. A line parallel to this one will also have a slope of -3.

Plug this value (-3) into your standard point-slope equation of y = mx + b.

y = -3x + b

To find b, we want to plug in a value that we know is on this line: in this case, it is (2, -4). Plug in the x and y values into the x and y of the standard equation.

-4 = -3(2) + b

To find b, multiply the slope and the input of x (2)

-4 = -6 + b

Now, add 6 to both sides to isolate b.

2 = b

Plug this into your standard equation.

y = -3x + 2

This equation is parallel/perpendicular to your given equation (y = -3x + 7) and contains point (2, -4)

Hope this helps!

rotation 90° clockwise about the origin​

Answers

Answer:

Take the picture you uploaded.

Click the rotate 'button' once.

Change the x to y and y to x on the graph. (axis labels)

Done

J (0, -1)

K(-4,-3)

I ( -4,-1)

∠A and \angle B∠B are vertical angles. If m\angle A=(5x-9)^{\circ}∠A=(5x−9) ∘ and m\angle B=(8x-30)^{\circ}∠B=(8x−30) ∘ , then find the value of x

Answers

9514 1404 393

Answer:

  x = 7

Step-by-step explanation:

Vertical angles have the same measure, so ...

  m∠A = m∠B

  (5x -9)° = (8x -30)°

  21 = 3x . . . . . . . . . divide by °, add 30-5x

  7 = x . . . . . . . . . . divide by 3

The graph below has the same shape as the graph of G(x) = x, but it is
shifted three units to the right. Complete its equation. Enter exponents using
the caret (-); for example, enter x4 as x^4. Do not include "G(x) =" in your
answer.
G(x) =

Answers

Step-by-step explanation:

The graph of Fx), shown below in pink, has the same shape as the graph of G(x)-x, but it is shifted to the right two units. Complete its equation below Enter exponents using the caret (a), for example, enter x as x 4. Do not include Fx)-in your answer. .5 5 F(x) = Answer: 0

The equation of the graph is,

⇒ G (x) = (x - 3)⁴

What is mean by Function?

A relation between a set of inputs having one output each is called a function. and an expression, rule, or law that defines a relationship between one variable (the independent variable) and another variable (the dependent variable).

Given that;

The graph of function G (x) is shown in image.

Here, The graph is 3 units left to function F (x) = x⁴.

Hence, The equation of the graph is,

⇒ G (x) = (x - 3)⁴

Thus, The equation of the graph is,

⇒ G (x) = (x - 3)⁴

Learn more about the function visit:

https://brainly.com/question/11624077

#SPJ7

Approximately 10% of all people are left-handed. Consider a grouping of fifteen people.

Write the probability distribution

Answers

Answer:

Step-by-step explanation:

Answer:

15*.1=1.5

so either one or two people of the 15 would be left handed

Can someone help me please! Thanks

Answers

This is a re-entrant hexagon (6 sides)
It can be cut into 4 triangles so the angle sum is 4 x 180 = 720 degrees
x = 720 - 84 - 99 - 157 - 24 - 281 = 75 degrees

Answer:

hello again.. I think you have a problem about figures

Step-by-step explanation:

please be brave when you try to solve..try to draw new lines to get angle and then look at the overall of shape.. the photo helps you good bye

A batch consists of 12 defective coils and 88 good ones. Find the probability of getting two good coils when two coils are randomly selected (without replacement).

Answers

Answer:

The probability of getting two good coils is 77.33%.

Step-by-step explanation:

Since a batch consists of 12 defective coils and 88 good ones, to determine the probability of getting two good coils when two coils are randomly selected (without replacement), the following calculation must be performed:

88/100 x 87/99 = X

0.88 x 0.878787 = X

0.77333 = X

Therefore, the probability of getting two good coils is 77.33%.

HELP PLSSSSS
Solve each system with substitution

Answers

Answer:

x = -1 and y = -3

Step-by-step explanation:

1.

y = x-2 ....(1)

y = 4x+1 ....(2)

Put the values of y from equation (1) to (2).

x-2 = 4x+1

-2-1 = 4x - x

-3 = 3x

x = -1

Now put the value of x in equation (1).

y = -1-2

y = -3

So, the values of x and y are -1 and -3 respectively.

Tim did a survey at a large shopping centre. He asked 400 visitors to the centre to choose the main reason for their visit. The reasons were shops, free parking, food court and location.
From the people taking part in the survey, one person is chosen at random to get a prize. Find the probability a female who chose location gets the prize.

shops free park. food location total
male 88 24 40 21 173
female 110 38 56 23 227
total 198 62 96 44 400​

Answers

Answer:

23 / 400 = 0.0575

Step-by-step explanation:

Given the distribution :

_____shops__ free park. food _: location total

male 88 24 40 21 173

female 110 38 56 23 227

total 198 62 96 44 400​

From the table of the distribution Given, we obtain :

n(Female n location) = 23

n(Total) = 400

Hence, the probability that a female who chose location gets the prize will be ;

n(Female n location) / n(Total) = 23 / 400 = 0.0575


A ball is thrown upward with an initial velocity (v) of 15 meters per second. Suppose that the initial height (h) above the ground is 7
meters. At what time will the ball hit the ground? The ball is on the ground when S = 0. Use the equation S = -52 + vt + h.
The ball will hit the ground in how many
seconds?

Answers

Answer:

Step-by-step explanation:

Your equation is weird. The position equation for this situation is

[tex]s(t)=-4.9t^2+15t+7[/tex] and set it equal to 0 to solve for the time it takes to hit the ground. Those times come out to be

t = 3.47 sec and t = -.411 sec. But since time can never be negative, our time is 3.47 seconds

(What is that -52?)

Choose all that apply:

1.Circle A and circle A', have the same circumference.
2.The radii of circle A and circle A', have the same lengths.
3. Points A and A', are both on the xxx-axis.
4. None of the above

Answers

Answer:

Step-by-step explanation:

1. Circle A and circle A', have the same circumference. (Yes)

2. The radii of circle A and circle A', have the same lengths. (Yes)

3. .... (No)

4. ... (No)

What is the probability that something with a 2.18% chance of occurring happens 3 times out of 194 events

Answers

Answer:

0.18431525 = 18.4%

Step-by-step explanation:

General Formula :

total trials Cn⋅p(success)^n⋅p(fail)^total−n

1198144* (.0218)^3 * (1-.0218)^191

help please!!!!!!!!!!!!!!!!!!!!!:):)​

Answers

Answer:

1-g

2-b

3-a

4-i

5-f

6-e

7-d

8-c

What do the chi-square test for independence, the Pearson correlation, and simple linear regressions all have in common

Answers

Answer:

They all test relationship when it involves two variables

Explanation:

All of the statistical methods listed above all measure the relationship between two variables.

The Chi Square test tests the relationship between two nominal/categorical variable groups.

The Pearson correlation test tests relationship between two continuous variables using the Pearson correlation coefficient to determine statistical relationship between them.

The simple linear regression measures relationship between two variables: dependent/response variable and independent/explanatory variable, to see if a relationship exists between by way of influence of the independent variable on the dependent variable.

A trucking company buys 25,275 gallons of gasoline. The federal excise tax is $0.195 per gallon. Find the amount of excise tax due. (Round your answer to the nearest cent if necessary)​

Answers

Answer: 5,055

Step-by-step explanation

multiply the amount of gallons purchased by tax and round up

$4928.625 is the answer.

An Excise tax is an indirect tax, usually paid by the manufacturer or retailer of the product. then passes along in the price of the product to the consumer.

Amount of gasoline = 25,375 gallons.

The Excise tax = $0-195/gallon.

The amount of Excise tax dece = 25.875 X $0.195

= $4928.625

Se the amount of Excise tax due for 25975 gallons of gasoline is $ 4928.625

what is Excise tax?

Excise tax is generally a tax levied on the sale of a particular good or service or for a particular purpose. State excise taxes are usually levied on the sale of gasoline, air tickets, heavy trucks, road tractors, tanning beds, tires, cigarettes, and other goods and services.

Excise can be used to charge prices for externalities or to discourage the consumption of goods by others. They can also be used as royalties to generate income from people who use certain government services. Income should be used to maintain those government services.

Learn more about excise tax here:https://brainly.com/question/2871942

#SPJ2

I'm not sure if this will be easy for some of you I really need help

Answers



8t-(5-2t) = 5(2t-1)

distribute the negative on the left side, distribute on the right

8t-5+2t = 10t-5

combine like terms

10t-5 = 10t-5

t=0 or (-infinity, infinity)


This is the graph of y=x^2+2x-2 what is the range of this function

Answers

The range is [-3, ∞)

simplify 2x²y²÷m³×m²÷2xy​

Answers

x^3y^3 divided by m is the answer
Other Questions
Type the correct answer in the box. Soybean oil is used in food production and cooking. In 2007, the United States produced 3.06 billion bushels of soybeans, and 65% of the harvest was used to make soybean oil. billion bushels of soybean oil were used for other purposes. change this into indirect speech.Paul says,"Windhoek is a wonderful city" Which numbers are solutions to the inequality X > 14- 5? Check all that apply.fractions larger than14.decimals larger than 14145whole numbers larger than 14the number 14fractions smaller than 142 Four friends all give each other presentsThe total costs of presents is 80.52Work out the mean cost of presents in pounds You are given the following data on US Treasury. The maturity date is May 15, 2041. The asked yield-to-maturity is 2.128%. The coupon rate is 2.35%. You agree to buy the bond June 21, 2021. Assume T 2. Par is $1,000. What is the clean (flat) price Suppose that a Country Club is considering what price to charge for adults. They know that if they charge a price of $100 then 70 adults will join and if they charge a price of $120 then 50 adults will join. What is the absolute value of the price elasticity of demand for adults at this Country Club Plateau Indian tribal leaders were chosen based onhereditary rules.likability.merit.social status. HELP TIMED QUESTION. Determine whether the equation is an identity or not an identity. Allen is looking through his weekly local grocery store newspaper ads he notices that Costco is advertising a pack of 60 eggs for $9.35 Safeway is advertising a dozen eggs for $4.79 and Trader Joe's is advertising a pack of 18 eggs for $6.18 which store is offering the better deal? helppp!! 21 - 3y = -183x+ y = -5 . . . . . . . Ok rotation 90 degrees counterclockwise about the origin Fluorometers are designed so that the path of the excitation light is at a right angle to the path of the emitted light. What is the purpose of this design 3.Salary: A sales clerk receives a monthlysalary of $500 plus a commission of 6% on allsales over $3500. What did the clerk earn themonth she sold $8000 in merchandise? which of the following advertisements effectively appeals to logic The reaction below shows how the potential energy changes during a phasechange. What does the red arrow show?Potential EnergyReaction ProgressA. The change in enthalpy is positive, and the reaction isendothermic.B. The change in enthalpy is negative, and the reaction is exothermic.C. The activation energy is negative, and the reaction is exothermic.D. The activation energy is positive, and the reaction is endothermic. Given the number of hours spent amusing ourselves to death with screen time, how many Titanics could we have built in one year if all those hours had been spent building Titanics what is the machine used to check melting point called? A club of 10 people wants to choose an executive board consisting of president, secretary, treasurer, and three other officers. In how many ways can this be done A student distills a sample of ink. Devise a simple method to show that the liquid collected is pure water. Include the expected results in your answer.