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
// This pseudocode is intended to describe
ddd [48]

Applying given information of a computational language in pseudocode, a code may be written to represent computing the price of an item on sale for 10% off.

<h3>What is a pseudocode?</h3>

A pseudocode can be considered as a depiction of the steps represented in an algorithm, usually in plain (natural) language.

<em>//This </em><em>pseudocode </em><em>is intended to describe</em>

<em>//computing the </em><em>price </em><em>of an </em><em>item </em><em>on </em><em>sale </em><em>for 10% off</em>

<em>START</em>

<em>  input origPrice</em>

<em>  </em><em>discount </em><em>= origPrice * 0.10</em>

<em>  </em><em>finalPrice </em><em>= origPrice - discount</em>

<em>  output finalPrice</em>

<em>STOP</em>

<em>//This pseudocode is intended to </em><em>compute </em><em>the number</em>

<em>//of miles per </em><em>gallon </em><em>you get with your car.</em>

<em>START</em>

<em>  input milesTraveled</em>

<em>  input gallonsOfGasUsed</em>

<em>  milesPerGallon = milesTraveled / gallonsOfGasUsed</em>

<em>     //milesPerGallon is computed using </em><em>division</em>

<em>  output milesPerGallon</em>

<em>     //miles is misspelled, and the P in </em><em>milesPerGallon </em><em>should be uppercase</em>

<em>STOP</em>

<em>  //</em><em>Program </em><em>should end with stop</em>

<em>//This pseudocode is intended to describe</em>

<em>//computing the </em><em>per day cost </em><em>of your rent</em>

<em>//in a 30-day month</em>

<em>START</em>

<em>  input rent</em>

<em>  costPerDay = rent / 30</em>

<em>     // Comment indicates 31-day month</em>

<em>  output costPerDay</em>

<em>     // output should be </em><em>costPerDay</em>

<em>STOP</em>

Learn more about the pseudocode here :

brainly.com/question/13208346

#SPJ1

3 0
9 months ago
Henry has created a software product that manages a database of company clients. He wants to install the software on a client's
UkoKoshka [18]

Answer:

The answer is " Run the software on the original web browser practically".

Explanation:

The Virtual servers enable you to run programming not programmed to the devices. Let's all presume which Henry's software will operate on computers but not on the mac. Since Mac is unable to run this software, it can practically install Linux on MC and install this.

  • The several common software applications such as parallels, VMware, and Virtual machines could be practically used during mac to install windows.
  • Its platform operating system from a macOS software perspective is a true physical computer with almost everything set.
5 0
2 years ago
Quick!!!!!
Vlad [161]

Answer:

B. the current affairs page

Explanation:

it's a simple question

8 0
3 years ago
Read 2 more answers
In cell B7, enter a formula without using a function to determine the profit generated at the Downtown location by subtracting t
Archy [21]

Answer & Explanation:

The formula in the cell B7 would be:

"=B5-B6"

And now we will press "Ctrl+C" to copy the formula in the Cell B7. After copying we will select the cell range C7 to D7 and press "Ctrl+V" to paste this formula in the cell C7:D7 and then will press Enter key. Now what we see is results in C7:D7 which we can check in our calculator whether these are corectly calculated or not.

3 0
3 years ago
Which of the following is a database concept that allows for storage and analysis for a dozen to billions of data points?
nydimaria [60]

Answer:

C) Storage

Explanation:

I am sure of it.

5 0
3 years ago
Other questions:
  • Which statement about the subject line is true? The subject line can be found just below the message box. The subject line is ma
    13·2 answers
  • Jim, your organizations IAM, has been contacted by the Program Manager to assist in implementing the DIACAP. Jim is not required
    11·1 answer
  • Christina has been asked by the firewall administration group to identify secure network protocols that can be used to prevent n
    5·1 answer
  • O O O O O O O
    9·1 answer
  • Will give brainliest!<br> Who created binary, and does anyone have any idea how?
    13·1 answer
  • Snippet 1: check_file_permissions.c #include
    9·1 answer
  • True or False? Security code is almost always open source!<br> True<br> False
    8·2 answers
  • If a machine cycle is 2 nanoseconds , how many machine cycles occur each second?
    7·1 answer
  • Why would over-50 executives have a harder time buying into the idea of social media?​
    15·1 answer
  • Which program assesses and measures improper medicare fee-for-service payments (based on reviewing selected claims and associate
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!