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
Harlamova29_29 [7]
3 years ago
9

RrayList Mystery Consider the following method:

Computers and Technology
1 answer:
Oksana_A [137]3 years ago
5 0

Answer:

a)

int: [10, 20, 10, 5]

out: [0, 10, 20, 10]

b)

int: [8, 2, 9, 7, -1, 55]

out: [0, 0, 8, 9, -1, 55]

c)

int: [0, 16, 9, 1, 64, 25, 25, 14]

out: [0, 0, 0, 0, 16, 9, 64, 25]

Explanation:

What the code is doing is changing the list if and only if the item number i, where i is an odd position on the list, is greater than the item number i-1. If the condition mentioned is satisfied, the element number i is removed, and a zero is added to the beginning of the list; this is why the dimension of the input is equal to the output (for every element removed a zero is added).

Note:

  • The first item of a list is the item 0
  • .add method can receive two parameters the first indicating the position where the element will be added and the second the element to be added.
  • .get method allows you to select any element on the list by its index.
  • .size method gives you the size of the list
  • In the for loop i += 2 indicates an increment of two, since we start with i = 1 we are going to iterate through odd numbers i = 1,3,5,7...

 

You might be interested in
How are computers connected to one another?
sergeinik [125]

Answer:

They are connected through networks

Explanation:

N/A

7 0
3 years ago
Read 2 more answers
Match the term to the correct definition.
Sauron [17]
Correct Answer:
1. information processed or stored by the computer
data
2. two or more connected computers
network
3. a unique name that identifies an Internet site
URL
4. instructions that tell a computer what to do
Command
5 0
3 years ago
Clasifica los documentos comerciales en activo, pasivo o patrimonial para cada operacion:
julia-pushkina [17]

Answer:

I wish I could answer your question, but I believe that is no English.

Explanation:

6 0
3 years ago
What is an algorithm? An executable file that has been converted into machine language A set of markup instructions A set of ins
mario62 [17]

Answer:

A set of instructions to meet a requirement of some kind

Explanation:

An algorithm is a set of instructions to meet a requirement of some kind, not all the algorithm are for computers, we can form an algorithm of how to make a cake.

5 0
3 years ago
A company wants to transmit data over the telephone, but they are concerned that their phones may be tapped. All of their data i
erastovalidia [21]

Answer:

def encrypt_digit(digit):

   if type(digit) is int or float:

       digit = str(digit)

   hold = list()

   for x in digit:

       d = str((int(x) + 3)%10)

       hold.append(d)

   first = hold.pop(0)

   second = hold.pop(0)

   third = hold.pop(0)

   fourth = hold.pop()

   print(int("".join([third,fourth, first, second])))

encrypt_digit(7836)

Explanation:

The python function accepts a four-digit parameter which represents the data transmitted over the company's telephone network. The function encrypts the data by adding 3 to each digit and getting the modulus of division 10, then the digits are swapped and printed out encrypted and ready for transmission.

6 0
3 years ago
Other questions:
  • What does CSS stand for?
    8·2 answers
  • The email administrator has suggested that a technique called SPF should be deployed. What issue does this address?
    5·1 answer
  • Your colleagues are discussing the operation of a device in which packets are routed between VLANs on the device rather than hav
    7·1 answer
  • . Does Zuckerberg believe in the thought that “the endpoint is when you sell the
    15·1 answer
  • I need help with this​
    7·1 answer
  • Boardman College maintains two files—one for Sociology majors and another for Anthropology majors. Each file contains students'
    5·1 answer
  • Imagine you are responsible for making a presentation that includes a representation of the logic flow through a process. You un
    11·1 answer
  • Which best explains a password attached to a document?
    7·1 answer
  • When aJSP page is compiled, what is it turned into?AppletServletApplicationMidlet
    14·1 answer
  • Which of the following safety and privacy features is not included in a P2P app or service?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!