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
ikadub [295]
3 years ago
7

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?
Computers and Technology
1 answer:
rewona [7]3 years ago
4 0

Answer:

[-1, 0, 1]

Explanation:

Given

The above procedure

Required

Which list does not work as intended

<em>The question has missing options (the options are available online).</em>

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.

<em>i.e. index ←← 1 </em>

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).

<em>Hence, it will return true, instead of false</em>

You might be interested in
The Mohs scale is used to express which mineral property?
olchik [2.2K]
Its answer is c. hardness

5 0
3 years ago
Select the correct answer.
Phoenix [80]
Data availability is the one related to the server being down.
4 0
3 years ago
List out the process of Assembly in the film editing process. NO LINKS. answer ASAP
kobusy [5.1K]

Answer:

just try your best

Explanation:

7 1
3 years ago
Read 3 more answers
When you see a yield sign what do you do?
ad-work [718]
Your supposed to yeild to whatever is around its like a stop sign in a way
3 0
3 years ago
Compare this country early use of credit to its use today?
Stolb23 [73]

Answer:

Explanation:

A credit is a financial transaction where someone takes a loan for a certain amount of money to another person, and this another must pay this money in a period of time, determinate from both parts, in this case, a country can get a credit, if this country pay this debt, the country will have a good record, and they can to ask another credit, but if they don't pay, the debt will be bigger.

7 0
3 years ago
Other questions:
  • Help plz
    5·1 answer
  • ​You work at a call center of a large bank where you answer credit card services related questions from customers. Lately, you h
    14·1 answer
  • A user reports that a file they shared out on their computer for another network user is not accessible to the third party. The
    5·1 answer
  • What is the purpose of a fax cover sheet?
    8·1 answer
  • What technology did one of the student's have to learn to use in order to help him with his homework in the film, "Disconnected:
    11·2 answers
  • Arrays of structures ________. Group of answer choices None of the above. are automatically passed by reference cannot be passed
    6·1 answer
  • Most project files will contain:
    9·1 answer
  • What is string literal in Java?
    5·1 answer
  • A computer has __________processing device
    13·1 answer
  • Figure out what this says:<br><br> ?driew tib a kool ti seoD
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!