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
ankoles [38]
2 years ago
9

Consider an algorithm that uses only assignment statements that replaces the quadruple (w, x, y, z) with (x, y, z, w). What is t

he minimum number of assignment statements needed?
Mathematics
1 answer:
Likurg_2 [28]2 years ago
6 0

Answer:

The minimum number of assignment statements needed is 5

Step-by-step explanation:

To write the algorithm, we apply the strategy of interchanging the values of variables in the assignment statements.

Assume "tmp" is the new variable, let assign tmp to w

The algorithm is:

Procedure exchange (w,x,y,z: integers)

 tmp := w

    w := x

     x := y

     y := z

     z := tmp

    return (w,x,y,z)

end

From the algorithm, it is obvious that there will be a minimum of 5 assignment statements needed.

You might be interested in
0.60p=p-32 what is the answer and work
nlexa [21]
Remember that p is the same as 1.00p. Subtract 0.60p from each side: 0=0.40p-32. Add 32 to each side: 32=0.40p.
If you multiply through by 10 you will get rid of the fraction: 320=4p. Now divide through by 4: 80=p so p=80 is the answer.
4 0
3 years ago
Find the altitude of triangle whose vertex is a(1,-2) and the equation of the base is X+y=3.
Sophie [7]

Answer:

2\sqrt {2}

Step-by-step explanation:

<u>Distance From a Point to a Line</u>

Given a line with an equation :

ax + by + c = 0

And the point (x_0,y_0)

The distance from the line to the point is given by

\displaystyle d=\frac {|ax_{0}+by_{0}+c|}{\sqrt {a^{2}+b^{2}}}

The triangle has a vertex at (1,-2) and the base lies on the equation

x + y = 3

Rearranging:

x + y - 3 = 0

The altitude of the triangle is the distance from the point to the line.

The values to use in the formula of the distance are: a=1, b=1, c=-3, xo=1, yo=-2:

\displaystyle d=\frac {|1*1+1*(-2)-3|}{\sqrt {1^{2}+1^{2}}}

\displaystyle d=\frac {|1-2-3|}{\sqrt {2}}

\displaystyle d=\frac {4}{\sqrt {2}}

Rationalizing:

\displaystyle d=\frac {4}{\sqrt {2}}\cdot\frac{\sqrt {2}}{\sqrt {2}}

\displaystyle d=2\sqrt {2}

The altitude of the triangle is \mathbf{4\sqrt {2}}

6 0
2 years ago
Im very bored. bbbbbbbbbbbbbbbbbbb
amm1812

Answer:

sameeeeeeeee

hru...??

7 0
2 years ago
Read 2 more answers
How do you work out 8 something 2 something 1 =24 ?
zaharov [31]
8<em>  times (</em>  2<em>  plus</em>  1 )  =  24
5 0
3 years ago
Read 2 more answers
Each car on a Ferris wheel travels 942.5 ft during 10 rotations of each ride. How high is each car at the highest point of each
Mumz [18]

Answer:

94.25 feet

Step-by-step explanation:

we can use the formula for the circumference of the circle to determine the diameter of the ferris wheel.

7 0
2 years ago
Other questions:
  • WILL AWARD BRAINLIEST!! PLEASE SHOW ALL WORK
    9·1 answer
  • Jerry is buying a new large screen television for his game room.He knows that the diagonal of the television measures 42.1 inche
    12·1 answer
  • What are the factors of 8 that add up to 6?
    14·2 answers
  • Can the set of lengths be the side lengths of a right triangle? 18 m, 24 m, 30 m
    8·1 answer
  • Students measured their heights. The dot plots display the data.
    5·1 answer
  • Hellllllllllllllllp plz...
    6·1 answer
  • In the equation y = 1/2x + 3, when x is 6, what is y?
    11·2 answers
  • Y varies inversely with x: If y = 10 while x = 3, find y when x = 6.
    9·1 answer
  • HELP!! PLS for points
    7·2 answers
  • The probability that Janet will win the marathon is 44%. What is the probability that Janet will not win the marathon? Write the
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!