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
What do you mean by computer ethics?​
STALIN [3.7K]

Answer:

Computer ethics is a field of applied ethics that addresses ethical issues in the use, design and management of information technology and in the formulation of ethical policies for its regulation in society.

3 0
2 years ago
Mark for review (Will be highlighted on the review page) 11. A feature in Excel that allows you to graphically display in a sing
Tresset [83]
A feature in Excel that allows you to graphically display in a single cell the trend across a range of cells is called a sparkline.
8 0
3 years ago
True or false mobile devices need to work within limited screen space
eduard
A phone may have a 4 inch screen and so it cant just extend to 5 inches. So it would he true
3 0
3 years ago
Read 2 more answers
One shortcoming of rapid application development (RAD) is _____.
VladimirAG [237]
One shortcoming of rapid application development (RAD) is a narrow focus, which might limit future development.
8 0
3 years ago
The four levels of FBLA membership
Nataly_w [17]

Answer:

Future Business Leaders of America (FBLA) for high school students; FBLA-Middle Level for junior high, middle, and intermediate school students; Phi Beta Lambda (PBL) for post secondary students; and Professional Division for those not enrolled in school or post secondary school

Explanation:

7 0
3 years ago
Other questions:
  • Which piece of personal information do websites often require users to enter?
    6·2 answers
  • Informs the network interface card to pass packets sent to that address to the ip stack so their contents can be read, and tells
    9·1 answer
  • Write a function that iteratively appends random 1's and 0's to an array to form a binary number. The function returns the binar
    13·1 answer
  • Type dig www.example A in order to get the IP address of www.example. What’s the TTL of the A record returned in the response? W
    9·1 answer
  • When were anonymous inner classes added to java?
    10·1 answer
  • What education and training is required to be an applications software engineer?
    9·1 answer
  • Which of the following techniques would a Baroque composer most likely employ to evoke an affect of agitation? Select one:
    14·1 answer
  • Hey guys. Can u help me pls? I need to add number1 and number2 together on Python, I don't know what I'm doing wrong. Thx for yo
    7·2 answers
  • Define a function called 'findWordFreq, which takes two parameters. The first parameter, 'text" is an nltk.text.Text object and
    8·1 answer
  • What does an effect allow you to do in<br> EarSketch?
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!