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
Solve -5 + w/3 = -1.
Liula [17]

Answer:

w = 12

Step-by-step explanation:

-5 + w/3 = -1

w/3 = 4 (Add 5 to both sides)

w = 12 (Multiply 3 by both sides)

3 0
4 years ago
Write the equation of a line that passes through (-3/2, -5) and perpendicular to a line that contains (-1, -2) and (-2, -8).
liraira [26]

Answer:

find gradient/slope

-8-(-5) / -2-(-1) = -3/-1

= 3

y=3x+c

perpendicular line formula

m1(m2)= -1

(sub in the gradient before)

3(m2)= -1

m2= -1/3 ( perpendicular line gradient)

y=-1/3x+c

(sub in the coordinate)

-5=-1/3(-3/2)+c

-5=1/2+c

-11/2=c (y intercept)

answer: y= -1/3x - 11/2

3 0
3 years ago
A machinist drilled a conical hole into a cube of metal as shown.
Mnenie [13.5K]

Answer:

512ft³

Step-by-step explanation:

If the cube its sides of all 8 feet, then the length, width, and height is 8 feet. Then, multiply 8 by 8 you get 64 and then multiply 64 by 8 to get 512.

7 0
3 years ago
Please assist!
Sedaia [141]
Take the third equation and divide it by 2.  If the equations are the same, they have infinitely many solutions because every point on one eq. is the same on the other. You can say they overlap.
5 0
4 years ago
Lisa built a rectangular flower garden that is 4 meters wide and has a perimeter of 26 meters.
Kazeer [188]

Answer:

9 m

Step-by-step explanation:

Given that

Width of rectangular flower garden, w = 4 m

Perimeter of rectangular flower garden, p = 26 m

To find:

Length of Lisa's flower garden = ?

Solution:

First of all, let us understand perimeter, length and width of a rectangle.

Let ABCD be a rectangle. Please refer to the attached image.

Opposite sides of a rectangle are equal to each other.

AB = CD = Length  

Let the length be l m.

BC = DA = Width = 4 m

Perimeter of a closed image is equal to the sum of all the sides of the image.

So, perimeter of ABCD:

p = AB + BC + CD + DA \\\Rightarrow  \bold{ p = 2 \times (Length +Width)}

26 = 2 \times (l +4)\\\Rightarrow 2l =26-8\\\Rightarrow \bold{l = 9 m}

7 0
3 years ago
Other questions:
  • HELP ME PLS W 23 AND 24
    6·1 answer
  • DEF is a dilation image of <br> ABC. What is the scale factor?
    14·2 answers
  • Yolo has 2 pieces of string. One is 32 inches long, the other is 48 inches long. She wants to make as many necklaces as she can,
    8·2 answers
  • Jordan bought 9/16 of a pound of sunflower seeds and divided them evenly into 9 snack bags for his lunch what is the weight of s
    11·2 answers
  • In Bear Creek Bay in July, high tide is at 1:00 pm. The water level at
    13·1 answer
  • Of the last 100 customers entering a computer shop, 25 have purchased a computer. If the classical method for computing probabil
    6·1 answer
  • What is the intersection of two coplanar, non-parallel lines?
    13·1 answer
  • Samuel took an Antigua clock that his grandfather had purchased, to be appraised the appraiser evaluated the current price of th
    12·1 answer
  • How many times does 6 go into 59
    8·1 answer
  • 5-6 study guide and intervention graphing inequalities in two variables
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!