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
Irina-Kira [14]
3 years ago
12

Assume the method dosomething has been defined as follows: public static void dosomething (int[] values, int p1, int p2) { int t

emp = values[p1]; values[p1] = values[p2]; values[p2] = temp; } what does the method do?3
Mathematics
1 answer:
Fudgin [204]3 years ago
4 0
First step is to analyze input and output variables:
INPUT:
list of integers with name "values"
integer with name "p1"
integer with name "p2"
OUTPUT:
there is no output variable as in declaration of a method there is void

ANALYSIS:
"<span>int temp = values[p1]"
this line creates variable "temp" which is integer. then this line goes to the list "values" and takes value that is at position "p1" and stores it into variable "temp"

"</span><span>values[p1] = values[p2]"
this line </span>goes to the list "values" and takes value that is at position "p2" and stores it into variable that is at position "p1"

"<span>values[p2] = temp"
this line takes value of the variable "temp" and stores it into list values at position "p2"

Short explanation:
this code replaces values of the list at between positions p1 and p2</span>
You might be interested in
Ahome cleaning service takes more time to clean larger spaces. The table shows the number of minutes it takes for
Naily [24]

Answer: the answer is b.

Step-by-step explanation: if you read the graph, you will see number of square feet, X the third one over you will see 100 over 40 and if you duplicate both then you get 200 for the number of square feet and 80 minutes, I hop this helps ツ.

4 0
3 years ago
Read 2 more answers
Twenty-nine percent of americans say they are confident that passenger trips to the moon will occur in their lifetime. You rando
galina1969 [7]

Answer:

The probability is 0.0014

Step-by-step explanation:

When we have two possible outcomes p, q and we repeat the experiment multiple times, we apply the Binomial distribution, in this distribution the probability of getting exactly k successes in n trials is given by

P(X=k)  = nCk(p)^k(1-p)^{n-k}

where p represents the probability of success. nCk refers to the combinations of k elements out of n elements.

In this case, p= .29 (the probability that the person says "yes" being confident that passenger trips to the moon will occur in their lifetime.

q = .71 (The probability that the person says "no")

We sample 200 americans, therefore, we have n = 200 and we need the probability that less than 40% of the people sampled answer "yes".

The 40% of 200 is 80. So, in other words, we need less than 80 people to answer yes to the question.

P(x<80) = P(x=0) + P(x=1) + P(x=2) + .... + P(x=79) = 0.00143466294 (we can use a Binomial Distribution calculator to compute this result)

Therefore, P(x < 80) = 0.0014

8 0
4 years ago
What is the reference angle of -139 degrees
katrin [286]

41º

1) Since we want to find the reference angle for a -139º angle, we need to resort to the following formula

Reference\:Angle\:\:Quadrant\:III=180^{\circ}-139^{\circ}=41^{\circ}

2) Note that a -139 angle is in quadrant III, since negative angles are clockwise oriented

3) Thus the Reference Angle is 41º

6 0
2 years ago
Read 2 more answers
The rational number<br>number ———————<br>is equal to its negative​
Zarrin [17]
Zero is equal to its negative
3 0
3 years ago
Find the value of each variable ​
yanalaym [24]

Answer:

i think teh value of each variable is 45.

Step-by-step explanation:

7 0
3 years ago
Other questions:
  • What is 3/4 written as a decimal
    14·2 answers
  • Help me please!!! I reallyyyy need help
    10·1 answer
  • Use the confidence level and sample data to find a confidence interval for estimating the population mu. Round your answer to th
    7·1 answer
  • Can a triangle of 72/12 fit on the same line as 144/24
    10·1 answer
  • Two decimals numbers, to the thousandths, that have a sum of about 5 and a difference of about 3. Then do the math to prove it w
    11·1 answer
  • The length of a rectangular prism is four times the width. The height of the prism is 160ft^3, what is the width of the prism? R
    12·1 answer
  • Solve 9x-7i&gt;3(3x_7u)​
    11·1 answer
  • Luigi's Fine Dining charges $32.09 for its prix fixe meal plus $39.26 for every drink, d, you purchase. The equation that models
    12·2 answers
  • What is the measure of angle x?<br><br> Enter your answer in the box
    12·1 answer
  • calls arrive at lynn ann fish's hotel switchboard at a rate of 2.0 per minute. the average time to handle each is 10 seconds. th
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!