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 makes a recipe for a meal an example of an algorithm?
LuckyWell [14K]

Answer:

B

Explanation:

Got it right on edge 2022

6 0
2 years ago
I NEED HELP ASAP:
Tresset [83]

Answer:

64

Explanation:

A truth table can be defined as a table that tells us more about a Boolean function.

A truth tables also gives us more information about how logic gates behave. They also show us the relationships between the inputs and outputs of a logic gates.

Logic gates are essential and fundamental components of an electrical circuit.

The rows on a truth table shows us the possible combinations of the inputs of a circuits as well as it's resulting or corresponding outputs.

In order to determine the number of rows that a truth table has, the formula below is used.

Number of rows in a truth table = (Number of Inputs)²

In the question above, we are told that

A truth table has 8 inputs and 5 logic gates. The number of rows needed for this truth table is calculated as:

Number of rows in a truth table = (Number of Inputs)²

Number of rows in a truth table = (8)²

= 64 rows.

5 0
3 years ago
Select the correct answer from each drop-down menu.
Lelu [443]

Answer:

First: .Net

Second: New Zealand

Explanation:

Net is short for Network.

NZ means New Zealand.

3 0
4 years ago
Read 2 more answers
What nomenclature, commands, procedures are used by the program to define capabilities in the following
JulsSmile [24]
Nomenclatures are the names in taxonomy like Homo sapiens etc
3 0
4 years ago
Once you fix the bug in a code, what is the last thing you should do?
aleksklad [387]

Answer:

Know what the code should do

4 0
3 years ago
Other questions:
  • You turn your computer on and the computer will not boot up where is something you should do to diagnose the problem?
    12·1 answer
  • How are computers used in producing weather forecasts?
    8·1 answer
  • Which item is most likely to be a standard part?
    14·1 answer
  • A user printed several documents to a shared network copier and noticed that they have very faint color density. A technician in
    9·1 answer
  • After an attacker has successfully gained remote access to a server with minimal privileges, which of the following is their nex
    15·1 answer
  • A device can transport objects instantaneously anywhere in the world without damaging them. Is it a creative invention? Yes, bec
    6·1 answer
  • Given an 10-bit two's complement binary number, what is the decimal value of the largest negative integer that can be represente
    10·1 answer
  • Define computer ?what is water pollution?<br><br><br>​
    15·1 answer
  • What makes a computer a computer?​
    12·2 answers
  • What is the difference between the dom api and the html dom api.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!