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
In the movie evacuees, why were the children evacuated from large cities?
lara [203]
Because large cities were targets for the German bombers
4 0
3 years ago
what is it called when someone uses software to run multiple operating systems on one computer at the same time? A.functional vi
Ronch [10]
The answer is C: Operating System Virtualization
8 0
3 years ago
Copyright laws protect:This task contains the radio buttons and checkboxes for options. The shortcut keys to perform this task a
agasfer [191]

B- Copyright laws protect original works both online and in print.

3 0
3 years ago
The multitasking, multi-user, operating system developed by Bell Laboratories that operates on a wide variety of computing platf
olasank [31]

Answer:

Unix

Explanation:

UNIX is simply an operating system developed by Bell Laboratories in the 1960s. Ever since then, it has been constantly worked upon and developed. It is an operating system because it is a suite of programs capable of making a computer to function. Unix is considered to be a stable, multi-user, and multi-tasking system for both desktops and laptops and even servers.

8 0
3 years ago
What tasks should a laptop accomplish?
Marta_Voda [28]

Answer:

general & personal used for computing.

3 0
3 years ago
Other questions:
  • Which of these is not a modifier?<br><br> short<br><br> unsigned<br><br> nest<br><br> long
    15·1 answer
  • What is the purpose of a title slide on power point
    14·2 answers
  • Helena purchased a security software package to protect her new laptop against threats such as spyware and computer viruses. she
    14·1 answer
  • What is the order of adding 10.0 to each element in a one-dimensional array of N real numbers?
    13·1 answer
  • What is a third variable condition that could create the following correlation?
    10·2 answers
  • What keyboard functions lets you delete words
    15·2 answers
  • What type of technology we need to use in order to make sure that users can freely room from one room to another one without wi-
    14·1 answer
  • What is the plan to make optimum usage of available spaces?
    15·1 answer
  • PLEASE HELP ITS CODING AND I INCLUDED A SCREENSHOT OF WHAT TO DO
    14·1 answer
  • Copy the formula in cell M7 to the range M8:M15, and edit the copied formulas to return the value from the column indicated by t
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!