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
Phantasy [73]
3 years ago
13

The code segment below uses the procedure IsPartOf (list, item), which returns true if item appears in list and returns false ot

herwise. The list newList is initially empty.FOR EACH item IN oldList{ IF (NOT IsPartOf (newList, item)) { APPEND (newList, item) }}Which of the following best describes the contents of newList after the code segment is executed?a. All elements in oldList which are repeated.b. All elements in oldList which are NOT repeated.c. All elements in oldList, including any repeats of elements.d. All unique elements in oldList NOT including any repeats of elements.
Computers and Technology
1 answer:
kakasveta [241]3 years ago
4 0

Answer:

Option d All unique elements in oldList NOT including any repeats of elements.

Explanation:

Given the function isPartOf() that will check if the input item is found in the input list.  Therefore if we run the following code segment

FOR EACH item IN oldList{

         IF (NOT IsPartOf (newList, item))

                 { APPEND (newList, item) }

}

the expression <em>NOT IsPartOf (newList, item) </em>will be evaluated to true if it encounter the first occurrence of a element and append the item to the newList. The repeat element will always be evaluated to False and therefore the repeat element won't be appended to the newList.

At the end, the newList will hold all the unique elements in oldList which doesn't include any repeats of elements.

You might be interested in
Implement a function inValues() that asks the user to input a set of nonzero floating-point values. When the user enters a value
elena-s [515]

Answer:

Explanation:

The following is written in Python and uses exception handling to do exactly as requested. It then goes adding all of the integer values to an array called num_list and finally adding them all together when the function ends.

def in_values():

   num_list = []

   while True:

       try:

           num = input("Input non-zero floating point: ")

           num = int(num)

           if num == 0:

               break

           else:

               num_list.append(num)

       except ValueError:

           print("No valid integer! Please try again ...")

           try:

               num = input("Input non-zero floating point: ")

               num = int(num)

               break

           except ValueError:

               break

   sum = 0

   for number in num_list:

       sum += number

   return sum

5 0
3 years ago
What type of attack is dependent on sending packets too large for the server to handle?
Art [367]
I think the answer is a kernel attack. Kernel attacks often send corrupted packets, but they also send large packets, allowing the server to crash and make an opening.
7 0
3 years ago
How many days till earth ends
expeople1 [14]
Several Billion years
5 0
3 years ago
a 50.5 force is applied to a golf ball generating an initial acceleration of 15 m/s2 caculate the mass of the golf ball.
siniylev [52]

Answer:

Mass = 3.37 Kg

Explanation:

<u>Given the following data;</u>

Force = 50.5N

Acceleration = 15m/s²

To find the mass of the golf ball;

Force is given by the multiplication of mass and acceleration.

Mathematically, the formula for force is;

F = ma

Where;

  • F represents force measured in Newton.
  • m represents the mass of an object measured in kilograms.
  • a represents acceleration measured in meter per seconds square.

Making mass (m) the subject of formula, we have;

Mass (m) = \frac{F}{a}

Substituting into the equation;

Mass (m) = \frac{50.5}{15}

<em>Mass = 3.37 Kg</em>

7 0
3 years ago
15
valina [46]

Answer:

B.

shutter priority mode

Explanation:

Shutter Priority, which is mentioned as S on the mode dial, and the mode is  the time value, and is demoted as Tv, that points out to the setting in different forms of cameras that allows all to select a particular shutter speed, and as meanwhile the camera balances the aperture to ensure correct exposure in the image.

7 0
4 years ago
Read 2 more answers
Other questions:
  • Why might you need to convert a file to another file type?
    14·1 answer
  • Which best explains why the world first civilizations developed in river valley's
    15·1 answer
  • Which of the following is NOT true about high-level programming<br> languages?
    9·2 answers
  • Why did the creation of ARPANET help with this critical need?
    9·1 answer
  • Images are available in many formats, such as tif, bmp, gif, jpeg, and ____.
    5·1 answer
  • A template class is a class in which ___________.
    15·2 answers
  • 1. Give one reason why data is represented in binary in a computer [1]
    10·1 answer
  • How much would you guys pay for a used ps4 with a black ops 3 disc?
    5·1 answer
  • Which would you use to get the number of elements in a dictionary?
    6·1 answer
  • Ntering a system call involves changing from kernel mode to user mode.<br><br> a. true <br> b. false
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!