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
Identify the type of error described
Arturiano [62]

Answer:

ZeroDivisionError

ValueError

Explanation:

ZeroDivisionError occurs when you attempt to divide a number by 0.

ValueError occurs when the argument passed into a function holds the wrong value. In this case, the string is not numeric which cannot be passed into the float() function.

Hope this helps :)

5 0
3 years ago
Is USA TestPrep a test-taking site that won't let you access other windows without kicking you off?
olga_2 [115]

Answer:

usatestprep literally just does what the name says; it prepares you for tests in america. it doesn't kick you off if you access other windows

Explanation:

3 0
4 years ago
Note: You can use a word document to write your answers and copy-paste your answer to the area specified. a. (5 points) Convert
MrMuchimi

Answer:

EA9_{16} = 3753

CB2_{16} = 3250

(1011 1110 1101 1011 1010)_2 = 781754

(1010 1000 1011 1000 1110 1101)_2 = 11057389

(1011 1110 1101 1011 1010)_2 = BEDBA

(1010 1000 1011 1000 1110 1101)_2 =  A8B8ED

74510_8= 221416

67210_8 = 203212

Explanation:

Solving (a): To base 10

(i)\ EA9_{16

We simply multiply each digit by a base of 16 to the power of their position.

i.e.

EA9_{16} = E * 16^2 + A * 16^1 + 9 * 16^0

EA9_{16} = E * 256 + A * 16 + 9 * 1

In hexadecimal

A = 10; E = 14

So:

EA9_{16} = 14 * 256 + 10 * 16 + 9 * 1

EA9_{16} = 3753

(ii)\ CB2_{16}

This gives:

CB2_{16} = C * 16^2 + B * 16^1 + 2 * 16^0

CB2_{16} = C * 256 + B * 16 + 2 * 1

In hexadecimal

C = 12; B =11

So:

CB2_{16} = 12 * 256 + 11 * 16 + 2 * 1

CB2_{16} = 3250

Solving (b): To base 10

(i)\ (1011 1110 1101 1011 1010)_2

We simply multiply each digit by a base of 2 to the power of their position.

i.e.

(1011 1110 1101 1011 1010)_2 = 1 * 2^{19} + 0 * 2^{18} + 1 * 2^{17} + 1 * 2^{16} +1 * 2^{15} + 1 * 2^{14} + 1 * 2^{13} + 0 * 2^{12} + 1 * 2^{11} + 1 * 2^{10} + 0 * 2^9 + 1 * 2^8 +1 * 2^7 + 0 * 2^6 + 1 * 2^5 + 1 * 2^4 + 1 * 2^3 + 0 * 2^2 + 1 * 2^1 + 0 * 2^0

(1011 1110 1101 1011 1010)_2 = 781754

(ii)\ (1010 1000 1011 1000 1110 1101)_2

(1010 1000 1011 1000 1110 1101)_2 = 1 * 2^{23} + 0 * 2^{22} + 1 * 2^{21} + 0 * 2^{20} +1 * 2^{19} + 0 * 2^{18} + 0 * 2^{17} + 0 * 2^{16} + 1 * 2^{15} + 0 * 2^{14} + 1 * 2^{13} + 1 * 2^{12} +1 * 2^{11} + 0 * 2^{10} + 0 * 2^9 + 0 * 2^8 + 1 * 2^7 + 1 * 2^6 + 1 * 2^5 + 0 * 2^4 + 1*2^3 + 1 * 2^2 + 0 * 2^1 + 1 * 2^0

(1010 1000 1011 1000 1110 1101)_2 = 11057389

Solving (c): To base 16

i.\ (1011 1110 1101 1011 1010)_2

First, convert to base 10

In (b)

(1011 1110 1101 1011 1010)_2 = 781754

Next, is to divide 781754 by 16 and keep track of the remainder

781754/16\ |\ 48859\ R\ 10

48859/16\ |\ 3053\ R\ 11

3053/16\ |\ 190\ R\ 13

190/16\ |\ 11\ R\ 14

11/16\ |\ 0\ R\ 11

Write out the remainder from bottom to top

(11)(14)(13)(11)(10)

In hexadecimal

A = 10; B = 11; C = 12; D = 13; E = 14; F = 15.

(11)(14)(13)(11)(10)=BEDBA

So:

(1011 1110 1101 1011 1010)_2 = BEDBA

ii.\ (1010 1000 1011 1000 1110 1101)_2

In b

(1010 1000 1011 1000 1110 1101)_2 = 11057389

Next, is to divide 11057389 by 16 and keep track of the remainder

11057389/16\ |\ 691086\ R\ 13

691086/16\ |\ 43192\ R\ 14

43192/16\ |\ 2699\ R\ 8

2699/16\ |\ 168\ R\ 11

168/16\ |\ 10\ R\ 8

10/16\ |\ 0\ R\ 10

Write out the remainder from bottom to top

(10)8(11)8(14)(13)

In hexadecimal

A = 10; B = 11; C = 12; D = 13; E = 14; F = 15.

(10)8(11)8(14)(13) = A8B8ED

So:

(1010 1000 1011 1000 1110 1101)_2 =  A8B8ED

Solving (d): To octal

(i.)\ 74510

Divide 74510 by 8 and keep track of the remainder

74510/8\ |\ 9313\ R\ 6

9313/8\ |\ 1164\ R\ 1

1164/8\ |\ 145\ R\ 4

145/8\ |\ 18\ R\ 1

18/8\ |\ 2\ R\ 2

2/8\ |\ 0\ R\ 2

Write out the remainder from bottom to top

74510_8= 221416

(ii.)\ 67210

Divide 67210 by 8 and keep track of the remainder

67210/8\ |\ 8401\ R\ 2

8401/8\ |\ 1050\ R\ 1

1050/8\ |\ 131\ R\ 2

131/8\ |\ 16\ R\ 3

16/8\ |\ 2\ R\ 0

2/8\ |\ 0\ R\ 2

Write out the remainder from bottom to top

67210_8 = 203212

8 0
3 years ago
salvado has a flash disk of 1.5GB and wants to store more music files of 950KBs each . How many files will he be able to store o
Katarina [22]

Answer:

Convert 1.5GB to KBs = 1500000kb

1500000kb/950kb ≈ 1579

Explanation:

4 0
3 years ago
While working on a presentation, Jack lost all the data because he switched off his computer unknowingly. On which of these comp
Lelechka [254]

Random Access memory(RAM) stores data temporary until the computer is switched off

3 0
3 years ago
Read 2 more answers
Other questions:
  • Assuming that data mining approaches are to be used in the following cases, identify whether the task required is supervised or
    12·1 answer
  • In a client/server architecture, an optional _____ is sometimes used to pass bulk information to the server. a. request line b.
    8·1 answer
  • When reading words with a scanner object, a word is defined as ____?
    15·1 answer
  • The primary reason for a company to outsource jobs is to
    8·2 answers
  • WILL UPVOTE ALL
    10·1 answer
  • Which methods will remove filters? Check all that apply.
    6·2 answers
  • Who is responsible for maintaining, monitoring, and analyzing database security at the back end?
    7·1 answer
  • 1. Microsoft Excel, MS Excel, or simply Excel is a______application by Microsoft Corporation. 2. Excel allows you to organize an
    13·1 answer
  • What are the features of the title bar for the Microsoft word application?​
    15·2 answers
  • Display unit is capable of displaying test but not ​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!