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
Mha lovers why do other anime lovers report mha lovers for not liking there anime?
kow [346]

Answer: because it's a lot of hate and dark fanfic but soetimes people are stuck up but we all have opinions

Explanation: Is this logical

3 0
3 years ago
Read 2 more answers
The space force enhancement function concerned with providing data on meteorological, oceanographic, and space environmental fac
Darya [45]

Answer:

Environmental Monitoring

Explanation:

The space force enhancement function concerned with providing data on meteorological, oceanographic, and space environmental factors that might affect operations in other battle-space dimensions is environmental monitoring.

8 0
3 years ago
An aircraft departs an airport in the mountain standard time zone at 1615 MST for a 2-hour 15-minute flight to an airport locate
almond37 [142]

Answer:

B. 1730 PST

Explanation:

First it is important to know that the flight lasted for 2 hours and 15 minutes, hence the first thing to do in this case is to add the duration of flight to the time of departure.

Time of departure = 1615 MST

Flight duration = 2:15

Hence we get 18:30 MST

Then we convert MST to PST by subtracting 1

1830 -1.00 = 1730 PST

5 0
3 years ago
Can someone please give me the 3.6 code practice answer I will mark you brainlyist
Stolb23 [73]

3.6 Code Practice Question:

Write a program to input 6 numbers. After each number is input, print the biggest of the number entered so far:

Answer:

nums = []

biggest = 0

for i in range(6):

    num = int(input("Number: "))

    nums.append(num)

    if(i == 0):

         print("Largest: "+str(nums[0]))

         biggest = nums[0]

    else:

         if nums[i]>biggest:

              print("Largest: "+str(nums[i]))

              biggest = nums[i]

         else:

              print("Largest: "+str(biggest))

                       

Explanation:

This question is answered using python

This line declares an empty list

nums = []

This line initalizes the biggest input to 0

biggest = 0

This iteration is perfoemed for 6 inputs

for i in range(6):

This prompts user for input

    num = int(input("Number: "))

This appends user input to the list created

    nums.append(num)

For the first input, the program prints the first input as the largest. This is implemented in the following if condition

<em>     if(i == 0):</em>

<em>          print("Largest: "+str(nums[0]))</em>

<em>          biggest = nums[0]</em>

For subsequent inputs

    else:

This checks for the largest input and prints the largest input so far

<em>          if nums[i]>biggest:</em>

<em>               print("Largest: "+str(nums[i]))</em>

<em>               biggest = nums[i]</em>

<em>          else:</em>

<em>               print("Largest: "+str(biggest))</em>

<em />

3 0
2 years ago
Son opciones de configuración espacio multimedia llamado blog
Softa [21]

NSaAnswer:

th

Explanation:

nks

6 0
3 years ago
Other questions:
  • Which option is referred to by the Animals tag?
    5·1 answer
  • A browser is used for creating Web pages. true or false?
    5·2 answers
  • When you touch a hot stove, along which pathway will the impulses travel and what is the final destination in the cns?
    12·1 answer
  • me pueden ayudar con mi trabajo sii porfss si me dan la respuesta correcta y les doy la mejor coronita si​
    12·1 answer
  • Once the CPU has fetched the data requested, what are the next steps in the process?
    15·1 answer
  • Many bookstores have closed since the rise of the Internet. What type of
    11·1 answer
  • Consider the following code segment.
    10·1 answer
  • What is the meaning of url <br>​
    7·1 answer
  • Which network device sends data to every device that is connected to it?.
    7·1 answer
  • consider a pipelined risc cpu with 14 stages. what is maximum speedup of this cpu over a non-pipelined implementation?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!