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
lana66690 [7]
3 years ago
10

write a function that takes two integer arrays as input return true if any two of the numbers in the first array input add up to

any of the numbers in the second array tests return false
Computers and Technology
1 answer:
Afina-wow [57]3 years ago
8 0

Answer:

Explanation:

This program is written in Python. It is a function that takes in two arrays. Then it loops through the first array twice, adding each element with the others and comparing the sum to the values in the second array. If a similar value is found in the second array, the program prints out the value and returns True to the user. Otherwise, it returns False. A test case has been created with two array variables that print out False, the output can be seen in the attached image below.

def sumArray(arr1, arr2):

   for i in range(len(arr1)):

       for x in range(len(arr1)):

           sum = 0

           if i != x:

               sum = arr1[i] + arr1[x]

           if sum in arr2:

               print(str(sum) + "Found in Second Array")

               return True

   return False

arr1 = [1, 9, 10, 44]

arr2 = [2, 4, 8, 14]

print(sumArray(arr1, arr2))

You might be interested in
Choose all of the items that accurately describe an operating system.
Simora [160]

Answer:

provides the platform that application software runs on, manages a computer's hardware, and implements features like file and folder management.

Explanation:

6 0
2 years ago
For each of the following languages, state with justification whether it isrecognizableor unrecognizable.(a)LHALT≥376={(〈M〉, x)
Scilla [17]

Answer:

See the picture attached

Explanation:

4 0
3 years ago
Which of these is NOT one of the three parts to the event-handling mechanism in Java?
Tamiku [17]

Answer:Event action

Explanation:Event-handling mechanism is the technique through which the  the management of any event is Java is controlled and coordinated. The event handler code is used for the managing of the mechanism and execution.

Event action is not a part of the event handling mechanism in the java because no such step comes under the code of event handler and rest other option are present in java event handler.

5 0
2 years ago
A technician would like to have the ability to add physical hard drives to a Storage Spaces storage pool at future times on an a
Iteru [2.4K]

Answer:

b. Thin provisioning

Explanation:

Thin provisioning is a storage space feature that makes allocating disk storage space flexible based on the space needed by each user, it improves the way storage space is utilized.

5 0
3 years ago
Which of these is an off-site metric for social media marketing?
Fudgin [204]
I will have to say c




3 0
2 years ago
Read 2 more answers
Other questions:
  • In your opinion, is it more beneficial to have many folders or is it better to “nest” subfolders? Explain your response.
    10·2 answers
  • It can be useful to have a mentor because they will help you
    7·2 answers
  • 2. What is an inanimate object? (1.0 points)
    14·1 answer
  • The fastest way to get help is to type a word or two in the search box.
    7·1 answer
  • Most hand sewing begins and ends with
    5·1 answer
  • What is Brainly?<br><br> A.Yes<br> B.No
    12·2 answers
  • A. Calculate the diffusion coefficient for magnesium in aluminum at 450°C.
    14·1 answer
  • Vegetable farming is a good source of income explain this statement<br>​
    5·1 answer
  • if someone has become very attached to their mobile device and feels anxious if the cannot connect to the internet, what are the
    7·1 answer
  • List any three positive impact of a computer​
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!