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
Which one is a correct answer
Kamila [148]
A. the pull mechanism
6 0
4 years ago
Read 2 more answers
Identify the problems that computer program bugs can cause. Check all that apply.
Sveta_85 [38]

Answer:

acde not b though

Explanation:

8 0
3 years ago
Read 2 more answers
What are the four steps of the research process?
pishuonlain [190]

Answer:

Step 1: Identify the Problem

Step 2: Review the Literature. ...

Step 3: Clarify the Problem Step 4: Clearly Define Terms and Concepts.

7 0
3 years ago
In the legend of sleeping Hallow what does Ichabod Crane fear the most
ahrayia [7]

Ichabod Crane is terrified of the headless horsemen

3 0
4 years ago
Read 2 more answers
What observations can you make about any of these data structures ? Go into as much as you can. Try proposing your own data stru
STALIN [3.7K]

Answer:Here Is An Example Data Structure We Can Struct Coordinate Int X; Intys Struct Square Coordinate Centers Coordinate Box[41; Here Is An Alternative Data Structure We Can Use To Describe Squares Struct Coordinate Int X; Int Y 2) Consider Our Drawing Example From Lecture. In The Below All We Can Draw Are Circles And Squares. Here Is An Example Data Structure

Explanation:

6 0
3 years ago
Other questions:
  • How many times will the while loop that follows be executed? var months = 5; var i = 1; while (i < months) { futureValue = fu
    10·1 answer
  • Are goals that<br> have concrete criteria for measuring<br> progress toward their attainment.
    5·1 answer
  • Assume that month is an int variable whose value is 1 or 2 or 3 or 5 ... or 11 or 12. Write an expression whose value is "jan" o
    10·1 answer
  • In the digital age we have less time to absorb and make sense of new information
    12·2 answers
  • Through the use of computational thinking techniques, models and algorithms can be created. A(n) ___1___ can be created that rep
    12·2 answers
  • 1) APPLICATION BASED QUESTION:-
    5·1 answer
  • Ayuda necesito 7 objetos que se utilizan en la vida diaria
    8·1 answer
  • How can using Prezi software for a presentation allow the presenter to better respond to audience needs?
    10·1 answer
  • Advancing technology has made life easier for people and businesses today. Imagine that you have to work for an entire day witho
    11·1 answer
  • You plays pokemon go
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!