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 of the following is the BEST reason to use cash for making purchases? everfi
alexgriva [62]

Answer: knowing what you spend".

Explanation:

The reason to use cash for making purchases is to know how much one has spent.

When we use cash rather than using credit card, it's easier for one to know how much that has been spent. Also, one can easily know when he or she need to stop spending. Therefore, the correct answer is "knowing what you spend".

8 0
3 years ago
The staff of the ___________________ will need to enter, maintain, and retrieve data from electronic health records within a hos
Fiesta28 [93]
THe staff of the medical office will need to enter, maintain and retrieve data from electronic health records within a hospital. EHR is the term used which means electronic health records that recorded all the health data of the hospitals.
5 0
3 years ago
Match the characteristics to the mobile operating system that it describes.
mel-nik [20]

Answer:

1. is Apple's iOS

2. is Android

3. is Microsoft

8 0
3 years ago
Selena needs to insert a comment in a webpage's code to ensure that other web team members who work with the page code understan
ANTONII [103]

Answer:

<!-- Modified by selena ramirez - for html compliance -->

Explanation:

In HTML, <!-- .. --> tag is used to insert comments in the webpage code.

Comments written inside the tag is visible only on the code, and is not displayed in the browsers when the page is requested by the client computer.

<em>Comment tag</em> is useful when there is a lot of code and multiple developers are dealing with the same code.

Comments help developers understand what changed is made and why.

5 0
3 years ago
In which of the following phases of filmmaking would a production team be focused on the process of casting?
Rzqust [24]

Explanation:

There are five phases of film production and they include development, pre-production, production, post-production and distribution.

3 0
2 years ago
Read 2 more answers
Other questions:
  • When possible, you should avoid using _________ variables in a program?
    11·1 answer
  • 7. Which innovation in video games do you think has been most significant? Include at least one way that innovation affects the
    6·1 answer
  • Wich technology can a website use to allow you to listen to a concert live over the internet?
    10·1 answer
  • Choose a project with a relatively simple description (building a LAN, designing a web page, inventing a new communication devic
    6·1 answer
  • When a user inserts a PivotTable, where will it be inserted?
    15·1 answer
  • Privacy Group of answer choices must be respected if we are to function as complete, self-governing agents is an absolute value
    5·1 answer
  • Two technicians are discussing a parasitic load test. Technician A says that the parasitic load is measured with an ammeter Tech
    13·1 answer
  • Write down the bit pattern in the fraction of value 1/3 assuming a floating point format that uses Binary Coded Decimal (base 10
    10·1 answer
  • Describe a way that you can envision using the power of the computer through
    13·1 answer
  • How do we Rewrite the following Python code to avoid error. mark=inpt("enter your mark ")
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!