The following procedure is intended to return true if the list of numbers myList contains only positive numbers and is intended to return false otherwise. The procedure does not work as intended. PROCEDURE allPositive(myList) { index ←← 1 len ←← LENGTH(myList) REPEAT len TIMES { IF(myList[index] > 0) { RETURN(true) } index ←← index + 1 } RETURN(false) } For which of the following contents of myList does the procedure NOT return the intended result?

Answers

Answer 1

Answer:

[-1, 0, 1]

Explanation:

Given

The above procedure

Required

Which list does not work as intended

The question has missing options (the options are available online).

From the question, we understand the procedure is to return true for lists that contain only positive numbers.

However, the list does not work for [-1, 0, 1]

The reason is that; the procedure starts checking from index 1.

i.e. index ←← 1

In [-1, 0, 1], the element at index 0 is negative (-1).

Since the procedure starts checking from index 1, the procedure will not check the element at index 0 (i.e. -1).

Hence, it will return true, instead of false

Answer 2

In this exercise we have to use the knowledge of computational language in python, so we have that code is:

It can be found in the attached image.

So, to make it easier, the code in python can be found below:

NumList = []

Number = int(input("Please enter the Total Number of List Elements: "))

for i in range(1, Number + 1):

   value = int(input("Please enter the Value of %d Element : " %i))

   NumList.append(value)

print("\nPositive Numbers in this List are : ")

for j in range(Number):

   if(NumList[j] >= 0):

       print(NumList[j], end = '   ')

See more about python at brainly.com/question/2266606

The Following Procedure Is Intended To Return True If The List Of Numbers MyList Contains Only Positive

Related Questions

Which of the following is true of how packets are sent through the Internet?

Packet metadata is only included on important packets to indicate they should get access to faster paths through the network

Packet metadata is used to route and reassemble information travelling through the Internet

Information sent through the internet is only encapsulated in packets if the message is too large to be sent as a datastream

Information sent through the internet is split into two packets, one which contains the message and another which contains the metadata

Answers

Packet metadata is used to route and reassemble information travelling through the Internet

-scav

What is the relationship between optical drives and WORMs?

Optical drives are advanced versions of WORMs.
WORMs do not affect optical drives.
Optical drives are susceptible to WORMs.
WORMs are types of optical drives.

Answers

Answer:

When data is written to a WORM drive, physical marks are made on the media surface by a low-powered laser and since these marks are permanent, they cannot be erased. Rewritable, or erasable, optical disk drives followed, providing the same high capacities as those provided by WORM or CD-ROM devices.

Explanation:

Good luck

In a word-processing program, what are the easily accessible icons that allow you to print, save and change fonts with a click of a button?

A- tool bar
B- keyboard shortcuts
C- preferences
D- printing options

Answers

The answer is A. tool bar

Item 3
Which of the following describes new technology development?

A harmless process

A somewhat assured process

A partially risky process

A very risky process

Answers

Answer:

A somewhat assured process

B. A somewhat assured process  is describes new technology development

What are the five phases in technology development process?

Five phases guide the new product development process for small businesses: idea generation, screening, concept development, product development and, finally, commercialization.

What is technology development process?

Technology Development Process, is a directed process at developing new knowledge, skills and artefacts that in turn facilitates platform development

To learn more about new technology development, refer

https://brainly.com/question/27090068

#SPJ2

Other Questions
If the girl skater has a mass of 30 kg and moves backward at 5 m/s, what is the velocity or the boy skaterhis mass is 50 kg? define one ampere current electricity THIS IS THE ANSWER, HAVEN'T GOTTEN A GRADE YET BUT IT'S RIGHT FOR SUREI'm aware this is wayyyyyy too long of an answer, but my grade is a lil low and i had to make ABSOLUTELY sure that I got a good grade Evaluate the extent to which human activity has caused changes in the environment, resulting in global responses in the period from 1900 to the present.THE ANSWER IS IN THIS GOO GLE D OC, I'LL POST OTHER ANSWERS AS I DO THE ASSIGNMENTS :) won't let me post the full link so put those spaces together and there you gohttps://do cs.g oogle.com/docu ment/d/10w-WVzOu_-f_2PDM3SXHRXfEP15VruVTQnV2hJzxnc0/edit?usp=sharing add 2 please add [tex]2 \frac{3}{4} + 5 \frac{4}{5} = [/tex] Hola ayudenme a) Redacte un parrafo con idea principal indictiva, con una idea secundaria de una especificacionb) redacte un parrafo con idea principal dedictiva con una idea secundaria que de una explicacin c) redacte un parrafo con idea principal implicita con palabras desconocidas Find the inverse of the function.f (x) = (x - 5)3= Item 3Which of the following describes new technology development?A harmless processA somewhat assured processA partially risky processA very risky process A pair of weak earthquakes is modeled by a system of inequalities. One earthquake occurred roughly 20 km east and 14 km north of the center of Columbia, NC. The quake could be felt from 25 km away. A couple days later, another earthquake occurred 8 km west and 3 km north of the center of Columbia and could be felt from 14 km away. If Columbia is located at (0, 0) on a coordinate grid, the system of inequalities represents this scenario.StartLayout Enlarged left-brace first row (x minus 20) squared + (y minus 14) squared less-than-or-equal-to 625 second row (x + 8) squared + (y minus 3) squared less-than-or-equal-to 196 EndLayoutWhich location relative to Columbia felt both earthquakes?4 km west and 12 km south6 km west and 4 km north2 km east and 10 km north6 km east and 8 km north Solve these equations: tan^2x-3tanx+2=0 y = x2 3x + 2use the discriminant to determine the number of solutions True or false: Invasive species are harmful in every single environment/ecosystem in the world. work out the value of (6-2.5)( 8+4) Find the missing side length.Assume that all intersecting sides meet at right angles.Be sure to include the correct unit in your answer. This problem shows division without a remainder. Transverse thrusters are used to make large ships fully maneuverable at low speeds without tugboat assistance. A transverse thruster consists of a propeller mounted in a duct; the unit is then mounted below the waterline in the bow or stern of the ship. The duct runs completely across the ship. Calculate the thrust developed by a 1900 kW unit supplied to the propeller if the duct is 2.6 m in diameter and the ship is stationary. A marketing company has asked you to voice your opinion about various topics, as part of a cultural study they are coordinating. Write your opinions in the form of comparisons using ms, menos, mejor, and peor and the adjectives as needed. OJO! Remember that adjectives have to agree with the nouns.Modelo:ms nutritivo: la hamburguesa / la ensaladaLa ensalada es ms nutritiva que la hamburguesa.peor: los Leones de Detroit / los Raiders de OaklandLos Leones de Detroit son peores que los Raiders de Oakland.1. ms cmico: George Lpez / Seth Rogenenter answer2. mejor: Dominos / Pizza Hutenter answer3. menos talentoso: Shakira / Jennifer Lpezenter answer4. ms rico: el chocolate puro / el carameloenter answer5. menos dulce: la manzana / la naranjaenter answer 1. Force is a push or aupon an objectA heatC. pullB. motionD. transfer2 Which is needed to make an object move?A densityC. porousB. forceD. non-porous 1. A train is moving north at 5 m/s on a straight track. The engine is causing it to accelerate northward at 2 m/s^2. How far will it go before it is moving at 20 m/s?A) 83 B) 43 C) 39 D) 94 E) 20 A local company had revenues of $2,800 last year. They spent 1/4 of their revenues on marketing and 1/7 of the remaining money on upgrading their facilities. How much money did they have left after marketing and upgrading the facilities? Group of answer choices What is factor for 7x^2-21-280