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
Atheel tests a program and gets a NameError. How can this be fixed?
Oksana_A [137]

Answer:

You can't call a function unless you've already defined it. Move the def createDirs(): block up to the top of your file, below the imports.

Explanation:

Some languages allow you to use functions before defining them. For example, javascript calls this "hoisting". But Python is not one of those languages.

7 0
3 years ago
Read 2 more answers
Marta is creating a program that will guide the user through a series of physical exercises. She wants the program to coach the
san4es73 [151]
She should use a condition-controlled loop. Because it uses a True/False and it will not continue until the task is done
7 0
2 years ago
Read 2 more answers
How many possible password of length four to eight symbols can be formed using English alphabets both upper and lower case (A-Z
Fynjy0 [20]

Answer:

In a password, symbol/characters can be repeated. first calculate the total

symbols which can be used in a password.

So there are total 26(A-Z),26(a-z),10(0-9) and 2(_,$) symbols.

that is equal to 26+26+10+2=64.

Total number of password of length 4:

here at each place can filled in total number of symbols i.e 64 way for each

place.Then total number of possible password is:

64*64*64*64=16777216

Total number of password of length 5:

here at each place can filled in total number of symbols i.e 64 way for each

place.Then total number of possible password is:

64*64*64*64*64=1073741824

Similarly,

Total number of password of length 6:

64*64*64*64*64*64=68719476736

Total number of password of length 7:

64*64*64*64*64*64*64=4398046511104

Total number of password of length 8:

64*64*64*64*64*64*64=281474976710656

Hence the total number of password possible is:285,942,833,217,536

7 0
3 years ago
Explain how you would assess the operating system requirements for virtualization if the organization wanted to virtualize 25% o
insens350 [35]

Answer:

The requirement of the virtualization in the operating system:

• The virtualization of the resources from single systems input can be partitioned into a small virtual environment in multiple system data processes.

• Virtualization can collect the physical system's hardware and software data, they can transfer the virtualization process and also verify that the working system is running properly.

• Virtualization has to determine the specific components such as workload, file location, network traffic and console administration process. The requirement for moving into the virtual environment must be selected based on windows for the operating system(32-bit), windows host operating system(4-bit) and Linux operating system.

7 0
3 years ago
Which of the main value components are contained in the value proposition "SportsAde offers serious athletes a great-tasting way
Elina [12.6K]

Answer:

Explanation:unique difference/benefits

- "a great-tasting way to stay hydrated during exercise" this is the benefit statement

2. product/service category or concept is

- the drink

3. target market

- "serious athletes" is the target market

4. offering name or brand is

- SportsAde

5 0
3 years ago
Other questions:
  • Weber believed that there is an inevitable destructive quality to which one of the four types of action?
    8·1 answer
  • When were anonymous inner classes added to java?
    10·1 answer
  • An Internet user has a need to send private data to another user. Which of the following provides the most security when transmi
    15·2 answers
  • A user calls to report that she is experiencing intermittent problems while accessing the wireless network form her laptop compu
    9·1 answer
  • What are the names of the 3 main languages used for making websites
    10·1 answer
  • The product of two integers is -180 if one of them is 12 find the other​
    14·1 answer
  • How to print wireless from laptop to samsung printer?
    6·2 answers
  • Communication media that use an antenna for transmitting data through air or water are called _____.
    14·1 answer
  • Please describe the role of games in modern society!
    5·2 answers
  • 100 POINTSSSSSSS!!
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!