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
In a _____ network, each device on the network is attached to a central router. If the router fails, then the other devices will
Damm [24]

Answer:

In a STAR TOPOLOGY network, each device on the network is attached to a central router. If the router fails, then the other devices will be unable to communicate, but if only one connected device fails, then all other devices will still be able to communicate.

Explanation:

In this type of topology all the computers are connected to a single router through a cable. This router is the central node and all others nodes are connected to the central node.

7 0
2 years ago
Write the following program in C++ to print:
Alenkinab [10]
1.
#include <iostream>#include <string>
using namespace std;
int main(){    string chars; // This is where we will put our @ signs and print them    for(int x=0;x < 5; x++){
        chars = chars + '@'; // This will concatenate an @ sign at the end of the variable        cout << chars << "\n";    }}

2.
#include <iostream>#include <string>
using namespace std;
int main(){    string name; // Our variable to store the name    cout << "What is your name? \n"; // Asks the user for their name    cin >> name;    cout << "\nWell, hello " << name << "!";}

3.
#include <iostream>#include <string>
using namespace std;
int main(){    int number; // Our variable    cout << "Enter a number\n"; // Asks for a number    cin >> number;    cout << "You entered " << number << "%!";}

4.
#include <iostream>#include <string>
using namespace std;
int main(){    int number; // Our variable    cout << "Enter a number\n";    cin >> number;
    int check = number % 2; // The modulo operator (the percent sign) gets the remainder of the quotient    if (check == 0) {        cout << number << " is even!"; // If the remainder is 0 then it prints out "x is even"    } else {        cout << number << " is odd!"; // If the remainder is not 0 then it prints out "x is odd"    }}

5.
#include <iostream>#include <string>
using namespace std;
int main(){    float r; // Our variable    cout << "Enter a radius\n";    cin >> r;    if (r < 0){        cout << "Lol. No."; // If the radius is less than zero print out that message    }    float circumference=2*3.14*r;    float area=r*r*3.14;    cout << "\n\n Circumference of circle: " << circumference;    cout << "\n Area of circle: " << area;}
4 0
3 years ago
In the retrieval phase of Godden and Baddeley (1975) study of the encoding specificity principle, participants were asked to sup
kicyunya [14]

Answer:

recall

Explanation:

Based on the scenario being described within the question it can be said that this was a recall measure of memory. In the field of neuroscience, a recall test refers to a type of test in which subjects are shows a certain stimuli and are later asked to remember as many stimuli as they can. Which in the case of the Godden and Baddeley (1975) study the stimuli were a set of words that were shown to the subjects.

5 0
3 years ago
What two benefits are a result of configuring a wireless mesh network? Check all that apply.
Andrei [34K]

Answer:

1)PERFORMANCE

2)RANGE

Explanation:

A mesh network can be regarded as local network topology whereby infrastructure nodes connect dynamically and directly, with other different nodes ,cooperate with one another so that data can be efficiently route from/to clients. It could be a Wireless mesh network or wired one.

Wireless mesh network, utilize

only one node which is physically wired to a network connection such as DSL internet modem. Then the one wired node will now be responsible for sharing of its internet connection in wireless firm with all other nodes arround the vicinity. Then the nodes will now share the connection in wireless firm to nodes which are closest to them, and with this wireless connection wide range of area can be convered which is one advantage of wireless mesh network, other one is performance, wireless has greater performance than wired one.

Some of the benefits derived from configuring a wireless mesh network is

1)PERFORMANCE

2)RANGE

7 0
2 years ago
Computers have drastically changed society over the last 20 years. How have computers affected communication in the business wor
iren2701 [21]

<u>Drastic change of over society Computers:</u>

In society computer has drastically changed and it has been used to for varies purpose to do analysis or storing data, as decisions making tools. Purpose computer been found is to do huge calculation. “Compute” word has been derived to computer. Computer later stage it diverted is purpose from calculation to information store device.

Computers have heavy effect the communication in normal word and business world. Especially social media took over the control of computers. In today’s world four type of ethical issue are known in computer mainstream in the workplace they are.

1. Crime (computer)

2. failure of responsibility in the computer.

3. Protection of software records and documents etc.

4. End user  data protection and privacy.

99% of computers are protected with firewalls and antivirus. But still hackers can hack the computer and steal the data.

5 0
3 years ago
Other questions:
  • How technology bacome the mode of revealing​
    10·1 answer
  • What Is the output of the following: =OR (5 &lt;7, 16*Rand ()&gt;23,FALSE)
    5·1 answer
  • On the Insert tab, select Table &gt; _______ to create a table from selected text.
    14·1 answer
  • The area of a square is stored in a double variable named area. Write an expression whose value is length of the diagonal of the
    6·1 answer
  • Activity
    7·1 answer
  • write a pay-raise program that requests a person's first name, last name, and current annual salary, and then displays the perso
    6·1 answer
  • This finding maximum number function will keep on going until we reach at the last value
    12·1 answer
  • In java I need help on this specific code for this lab.
    5·1 answer
  • Help me to solve please​
    8·2 answers
  • 1. How is the pronoun their used in the second sentence?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!