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
eimsori [14]
3 years ago
11

In a List of Positive Integers, Set MINIMUM to 1. For each number X in the list L, compare it to MINIMUM. If X is smaller, set M

INIMUM to X.” Read this STATEMENT very carefully and Answer the below Questions.
A. Will this Algorithm RUN?? Yes or No with a justification

B. Will X Replace Any Value or Not?
Computers and Technology
1 answer:
Dvinal [7]3 years ago
4 0

Answer:

The answer to this question is given below in the explanation section.

Explanation:

The given problem scenario is:

In a List of Positive Integers, Set MINIMUM to 1. For each number X in the list L, compare it to MINIMUM. If X is smaller, set MINIMUM to X.

The answer to question A is: this algorithm will not run because:

If you a list of a positive number and you have already set it MINIMUM to 1, the comparison result with MINIMUM will not obtain. For example, lets suppose a list of numbers L. L={1,2,3,1,1,5,4,3,2}. You have already set the Minimum to 1. When you compare each number X in the list, if X >MINIMUM, then set MINIMUM to X.  

This will not work, because there are positive numbers in the list and the minimum positive number is 1. So the algorithm, will not execute the if-part.

In short, the pseudo-code of this problem is given below:

<em>L={list of positive number e.g. 1,2,3,.......Xn}</em>

<em>MINIMUM=1</em>

<em>foreach ( X in L)</em>

<em>{</em>

<em>(if X<MINIMUM)</em>

<em>    { </em>

<em>        MINIMUM=X</em>

<em>    }</em>

<em>}</em>

The answer to question B is X will not be replaced because X  replaced with MINIMUM only when if-part of this algorithm get executed. However, it is noted that X will not replace any value, if if-part will get executed, the Variable MINIMUM will get replaced with any value.

You might be interested in
Un comerciante de régimen código para comprar mercancías gravadas a un comerciante de régimen simplificado precio de venta al pú
Genrish500 [490]

Answer:

El valor sin impuestos de las mercancías era de $1.512.605.

Explanation:

Dado que un comerciante de régimen código para comprar mercancías gravadas a un comerciante de régimen simplificado pagó un precio de venta al público 1.800.000 incluido el IVA tarifa general (19%), para determinar el valor de las mercancías sin el impuesto incluido se debe realizar el siguiente cálculo:

1.19 = 1.800.000

1 = X

1.800.000 / 1.19 = X

1.512.605 = X

Por lo tanto, el valor sin impuestos de las mercancías era de $1.512.605.

5 0
3 years ago
Which country has the most common features of analogue and digital computer​
ANTONII [103]

Explanation:

i don't think rhis question could be..

4 0
3 years ago
Mi laptop dice the computer restarted unexpectedly or encountered an unexpected error.Windows installation cannot procced.To ins
borishaifa [10]

Answer:

Explanation:

There are two reasons as to what could have happened with your laptop. The first one is that your laptop was installing a critical windows update which got corrupted when the laptop's battery died causing windows itself to become corrupted. In this case, you would need to format the hard drive and reinstall windows. The second reason could be that your hard drive is failing and not allowing Windows to load or properly be installed on it. In this second scenario you would need to buy and replace the hard drive.

4 0
3 years ago
Is the following an example of social media viral marketing? Indicate your response by selecting yes or no. When you sign onto y
Vladimir [108]

Answer

yo im sorry give me points b

Explanation:

gasefe

3 0
3 years ago
How would you add the double 75.6 to the end of an ArrayList of Doubles named myDoubles?
eduard

Answer:

myDoubles.add(75.6);

Explanation:

ArrayList<Double> myDoubles = new ArrayList<Double>();

myDoubles.add(10.8);

myDoubles.add(92.46);

myDoubles.add(75.6);

The above code creates a double ArrayList called myDoubles. We add 10.8 and 92.46 initially. After these numbers, 75.6 is added to the myDoubles using <em>add</em> method (You need to type the list name, ".", and the method name to add the number)

6 0
3 years ago
Other questions:
  • Drag each connector name to match the connector type shown.
    14·1 answer
  • Witch of the following attributes of a website indicates a more reliable source for information
    15·1 answer
  • Which of the following is a domestic business activity?
    6·2 answers
  • Mary is troubleshooting her company's LAN network. She finds out that data segments that the client is encoding are resulting in
    9·1 answer
  • • Write a program to find the maximum, minimum, and average score of players. The input to the program is a file containing play
    9·1 answer
  • our client, Rhonda, has come to you for advice. Rhonda has recently graduated from college and has a good job with a large compa
    6·1 answer
  • Write a Python function called readlinesmton that accepts the name of the file (i.e. filename), starting line number (i.e. m) an
    7·1 answer
  • What happens if a computer lags too much?
    14·2 answers
  • Write an algorithm to find the average of three numbers: 10, 20, 30
    7·1 answer
  • For each problem listed below, use the drop-down menu to select the field of the professional who can help solve the issue.
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!