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
I know that this will be taken down for not being a real question but is anyone else not able to search for anything? I can type
Schach [20]

Answer:

Sameee

Explanation:

6 0
3 years ago
Which best describes the benefits of renting a home
ANTONII [103]
Is it multiple choice or an essay question? If its an essay question I would say Living alone, being able to rent YOU'RE own home, and probably being able to decorate it the way you want. 
5 0
3 years ago
Read 2 more answers
Which are three possible text formatting actions in wordpad?
DaniilM [7]

Answer:

Font, Bold, italic, colored, centered text...

7 0
3 years ago
In a Java conditional statement, on what does the value of the variable depend?
Butoxors [25]

Answer:

whether the Boolean expression is true or false

8 0
2 years ago
When using a software budget, you should feel very confident if you choose a solution that looks like it will come in exactly on
ludmilkaskok [199]

Answer:

probably false

Explanation:

because u dont want a budget to b exact u want it completely covered

3 0
3 years ago
Other questions:
  • Write a program that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follo
    5·1 answer
  • A computer can sort x objects in t seconds, as modeled by the function below:
    5·1 answer
  • Alan is the security manager for a mid-sized business. The company has suffered several serious data losses when mobile devices
    9·1 answer
  • What percentage of people with internet access use emojis?
    11·1 answer
  • Any executable files???
    5·1 answer
  • You are planning a storage solution for a new Windows server. The server will be used for file and print services and as a datab
    6·1 answer
  • Who plays Rblx?? What do yall play?
    9·2 answers
  • ANSWER QUICKLY PLEASE
    7·1 answer
  • HELP PLZZZZZZ
    10·1 answer
  • Which of the following is true of lossy and lossless compression techniques?
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!