Write the function appendEvens() which, given two arrays, adds all of the even elements from the first to the second. You may assume the second has enough space.

Answers

Answer 1

Answer:

function appendEvens( arr1, arr2) {

   for (let i in arr1){

       if (i%2 == 0){

           arr2.push(i);

       }

   }

}

Explanation:

The defined javascript function "appendEvens" is a function that returns undefined. It accepts two arrays and pushes the even numbers from the first array to the second.


Related Questions

Need help with 4.7 lesson practice edhesive

Answers

Answer:

Question 4 => 4th answer: The first line should be for x in range (7, 10):

Question 5 => 2nd answer: 14 16 18 20 22 24 26 28 30 32

Explanation:

Question 4

"for" loops always need a variable (like "x") defined to iterate with different values.  for x in range (7, 10): makes x to take values 7, 8, 9 and 10 successively  and execute print(x) each time.

Question 5

The expression x in range (7, 16) makes x to take values from 7 up to 16 inclusive. So for each iteration it will execute print x*2 which prints the double of the actual value for x. Starting with x=7, it will print 14, then with x=8 will print 16, and so on. All values are shown on the table below:

X       Prints

7        14

8        16

9        18

10       20

11       22

12       24

13       26

14       28

15       30

16       32

The code segments are illustrations of loops.

4: The first line should be for x in range(7,10):5: The output is 14 16 18 20 22 24 26 28 30

The syntax of a for loop is:

for variable in range (begin,end+1):

The loop in question (4) is given as:

for range (7,10)

This means that, the variable is missing.

So, the first line of the code segment should be

for x in range(7,10):

For question 5, the value of x would range from 7 to 15.

The print statement prints twice x, followed by a space.

So, the output would be 14 16 18 20 22 24 26 28 30

Read more about loops at:

https://brainly.com/question/19323897

An anagram of a string is another string with the same characters in the same frequency, in any order. For example 'ab', 'bca, acb), 'bac', 'cba, 'cab' are all anagrams of the string 'abc'. Given two arrays of strings, for every string in one list, determine how many anagrams of it are in the other list. Write a function that receives dictionary and query, two string arrays. It should return an array of integers where each element i contains the number of anagrams of queryll that exist in dictionary.

Answers

Answer:

from collections import Counter

def anagram(dictionary, query):

   newList =[]

   for element in dictionary:          

       for item in query:

           word = 0

           count = 0

           for i in [x for x in item]:

               if i in element:

                   count += 1

                   if count == len(item):

                       newList.append(item)

   ans = list()

   for point in Counter(newList).items():

       ans.append(point)

   print(ans)        

mylist = ['jack', 'run', 'contain', 'reserve','hack','mack', 'cantoneese', 'nurse']

setter = ['ack', 'nur', 'can', 'con', 'reeve', 'serve']

anagram(mylist, setter)

Explanation:

The Counter class is used to create a dictionary that counts the number of anagrams in the created list 'newList' and then the counter is looped through to append the items (tuple of key and value pairs) to the 'ans' list which is printed as output.

What is the part of a CSS declaration that describes the HTML tag?
A.the selector
B.the pointer
C.the value
D.the property

Answers

Answer:

a selector

Explanation:

Answer:

A. the selector

For a typical program, the input is taken using _________ Command-line scanf Files All of the mentioned

Answers

Answer:

D)All of above

Explanation:

This is the complete question

For a typical program, the input is taken using _________.

A)Files

B)Command-line

C)scanf

D)All of above

E)None of these

computer program could be regarded as a collection of instructions which can be executed using computer to carry out a specific task, and it is written by programmer ,Input in domain of computer could be explained as feeding some data into a program. This input could be in the form of a file as well as command line, with the help of programming set of built-in functions that will help in reading the given input as well as feeding it to the program base on requirement. The scanf do reads the input from the standard input stream( stdin and scans) which is been input based on provided format. It should be noted that For a typical program, the input is taken using Files, Command-line and scanf.

Write a function called prod_all that takes any number of arguments and returns their sum. Test the function by using these two tuples (separately) as arguments: (1, 2, 3, 4) & (4,6,8): prod_all(1, 2, 3, 4) # The answer should be 24 prod_all(4, 6, 8) # The answer should be 192 [10]: def prod_all(*args): tupl = (args) total *= n # total = total *n

Answers

Answer:

from functools import reduce

def prod_all(*args):

   prod = reduce(lambda x,y: x *y, args)

   return prod

result = prod_all(4,6,8)

print(result)

Explanation:

The use of the "*args" passes a tuple of variable length to a python defined function. The function above takes any number of arguments and returns the product using the python reduce module and the lambda function.

who wants 100 points? comment buh. i don't rlly care buh.

Answers

Answer:

I do

Explanation:

Answer:

hey bae I do heheheheeheh

laptop components that can be replaced relatively easily include the ____ and the ____

first part
screen
power supply
RAM

second part
hard disk
keyboard
touchpad​

Answers

Answer:

Power supply and Hard disk

Explanation:

how does computer number system play a Vital role in a computer calculation. ​

Answers

Answer:

When we type some letters or words, the computer translates them in numbers as computers can understand only numbers. A computer can understand the positional number system where there are only a few symbols called digits and these symbols represent different values depending on the position they occupy in the number

Explanation: SAME AS

In a three-tier architecture, the component that runs the program code and enforces the business processes is the:_______.

Answers

Answer:

Application Server

Explanation:

The Application Server is a component in computer engineering that presents the application logic layer in a three-tier architecture.

This functionality allows client components to connect with data resources and legacy applications.

In this process of interaction, the Application Server runs the program code from Tier 1 - Presentation, through Tier 2 - Business Logic to Tier 3 - Resources, by forcing through the business processes.

What symbol following a menu command lets you know that a dialog box will be displayed? an ellipse an arrow a check mark a radio button

Answers

cords   and  batteries or electric radio

Answer:

It would be an ellipse


What is a file type and why is it important? Give at least three examples of file
types, including the associated file extension and
program.

Answers

What's in the setting file ?

Most operating systems perform these tasks. coordinating the interaction between hardware and software allocating RAM to open programs creating and maintaining the FAT modifying word processing documents correcting spreadsheet formulas displaying the GUI

Answers

Answer:

The answer are A.) Coordinating the interaction between hardware and software And B.) Allocating RAM to open programs

Explanation:

Hope this helps :)

Tasks that are been performed by most operating systems are;

Coordinating the interaction between hardware and software.Allocating RAM to open programs.

An operating system can be regarded as system software which helps in running of computer hardware as well as software resources and mange them.

This system provides common services for computer programs.

It should be noted that  operating system coordinating the interaction between hardware as well software.

Therefore, operating system, allocate RAM to open programs.

Learn more about operating system at:

https://brainly.com/question/14408927



16. When the speed limit is not posted, the default

speed limit recommends that drivers maintain a

speed of

mph on the highway and

mph in the city.

A. O 65, 40

B. O 60, 35

C. O 55, 30

D. O 50, 25

Answers

Answer:

C. 55, 30

Explanation:

Even though each state in the United States has different speed limits. However, in a situation whereby the speed limit is not posted, the default speed limit recommends that drivers maintain a speed of "55" mph on the highway and "30" mph in the city.

The highest speed limit in the United States is 85mph on a rural highway in Texas while the lowest generally for the country is 30mph in a residential area.

Ms office suite comes with its own set of pictures in the​

Answers

Answer:

clipart ...........................

Explanation:

clipart is the correct answer for the above question.

Which of the following statements about computational thinking are true? Select 3 options.

Answers

Answer:

The correct answer to this question is given below in the explanation section.

Explanation:

In this question the choices are missing, the choices of this question are:

The result of computational thinking is a problem broken down into its parts to create a generalized model and possible solutions, Computational thinking involves the techniques of decomposition, pattern recognition, abstraction, and algorithm development. Computational thinking is basically synonymous with programming. Computational thinking is a set of techniques used to help solve complex problems or understand complex systems Understanding all of the minor details about a problem is critical in computational thinking

The correct 3 choices about computational thinking that are true are given below:

1.The result of computational thinking is a problem broken down into its parts to create a generalized model and possible solutions.  

2. Computational thinking involves the techniques of decomposition, pattern recognition, abstraction, and algorithm development.

4. Computational thinking is a set of techniques used to help solve complex problems or understand complex systems.

Answer:

-The result of computational thinking is a problem broken down into its parts to create a generalized model and possible solutions.  

-Computational thinking involves the techniques of decomposition, pattern recognition, abstraction, and algorithm development.

- Computational thinking is a set of techniques used to help solve complex problems or understand complex systems.

Explanation:

I just took the test got a 100%

Complete the sentence.
Python converts your code into bytecode when you run your program. This process is an intermediate step in a process called______

Answers

Answer:

Compilation

Explanation:

" Python is an interpreted, high-level, general-purpose programming language. It is is dynamically typed and garbage-collected. "

But first it does a compilation for a file with the extension `.pyc`, so the answer is compilation, even though python is being interpreted

Python converts your code into bytecode when you run your program. This process is an intermediate step in a process called Compilation.

What is code?

The line of code returns the ASCII code.

ASCII, has the full form American Standard Code for Information Interchange. It consists of a 7-bit code in which every single bit represents a unique alphabet.

Python is a high-level computer programming language. It is dynamically used.

First, it does a compilation for a file with the extension `.pyc`

Python converts your code into bytecode when you run your program. This process is an intermediate step in a process called Compilation.

Learn more about code.

https://brainly.com/question/2596551

#SPJ2

Write a program that uses two input statements to get two words as input. Then, print the words on one line separated by a space. Your program's output should only include the two words and a space between them.

Hint: To print both words on one line, remember that you can concatenate (add) two phrases by using the + symbol. Don't forget that you'll need to add a space between the words as well.

Sample Run

Enter a word: Good
Enter a word: morning
Good morning

Answers

word1 = input("Enter a word: ")

word2 = input("Enter a word: ")

print(word1 + " " + word2)

I hope this helps!

20 POINTS Which of the following statements is true of subroutines? Check all that apply.

They can be used in multiple places.

They can be used in one place only.

They save a programmer time since they are reusable.

They can be used only once.

They can contribute to excessive use of a computer’s resources.

Answers

Answer:

1,3,5?

Explanation:

What are the different types of store-based and nonstore-based retail locations? Provide a real example (store name) for each different type.

Answers

Explanation:

For Store-based retail locations; they've been grouped on the basis of:

ownership, andthe type of merchandise offered  

I. On the basis of ownership, we have:

Independent retailer locationchain retail locationfranchise location

II. On the basis of merchandise offered, we have:

departmental store locationconvenience store locations supermarket locations

For Non-Store retail locations, ie. retailing that does not a physical store. These include;

direct sellingmail orderonline retailing outlets

How did Classical music help Gwenda?

Answers

Answer:

It helped her to speak in balanced phrases

Explanation:

HOPE THIS HELPS ;}

(plsssssssssssssssssssssssssssssssssssssss helpp meee)
think about system you know,list the parts of the system,describe some ways that the parts are connected to the whole​

Answers

Answer:

A computer is a complex machine. While most of it works on a microscopic level, it certainly has recognizable macroscopic components that contribute to its uses. A computer can be used to do just about anything from simple calculations to preparing reports to sending rockets into space to simulating the spread of cancer in body organs. Some of the parts are, the motherboard, the power supply, the central processing unit, the optical drive ect. The motherboard plays roles like storing some simple information when the computer is off, such as the system time. The power supply, as you might have already guessed is the powerhouse of the computer. The CPU mainly does arithmetic and logical tasks. It will make a bunch of calculations to ensure the functions of the computer are carried out efficiently. An optical drive is used to read CDs and DVDs, which can be used to listen to music or watch movies. They can also be used to install software, play games, or write new information into a disk.

Explanation: O///O sorry if this is bad....

QUESTION 3 / 10
Which of the following is the BEST reason to use cash for making purchases?
A. Keeping track of how much you have spent is simple.
B. Splitting bills with friends is easier.
C. Getting more cash from an ATM machine is easy to do.
D. Knowing what you have spent your money on is
simple.

Answers

A.keeping track of how much you have spent is simple

Individuals who break into computer systems with the intention of doing damage are called​ _____________.

a. white hats
b. ​e-criminals
c. hackers
d. keyloggers
e. black hats

Answers

I think the answer is hackers

The individuals who made the unethical entry into a person's system with intentions of damage are termed, hackers. Thus, option C is correct.

What is a computer system?

A computer system has been given as the network connection of the hardware and the software equipped with the objects that are used for the operation of the computer.

The computer system with the internet connection has been able to make the connection to the world. as well the invention mediates the work with ease as well.

The system thereby has the access to the passwords and the personal details of an individual as well. There are individuals who try to make access the computer system in an unethical way and intended to damage the system.

The computer viruses are used for the following purpose and were drawn by the hackers. Thus, option C is correct.

Learn more about the computer system, here:

https://brainly.com/question/14253652

#SPJ2

Some of the latest smartphones claim that a user can work with two apps simultaneously. This would be an example of a unit that uses a __________ OS.

Answers

Answer:

MULTITASKING OS

Explanation:

MULTITASKING OPERATING SYSTEM is an operating system that enables and allow user of either a smartphone or computer to make use of more that one applications program at a time.

Example with MULTITASKING OPERATING SYSTEM smartphones user can easily browse the internet with two applications program like chrome and Firefox at a time or simultaneously

Therefore a user working with two apps simultaneously is an example of a unit that uses a MULTITASKING OS.

Information System (IS) designed to provide reports to managers for tracking operations, monitoring and control is ________

Answers

Answer:

Management Information System(MIS)

Explanation:

management information system can be regarded as an information system

that is engaged in decision-making as well as the coordination and control and analysis of information in an organization. It involves processes as well as people and technology when studying the management information systems in organizational view.

In Management Information System(MIS) data can be gotten from the database, as well as the compilation of reports, this report could be inventory-level reports,

financial statements/analysis so that routine decision can be made by the manager. It should be noted that Management Information System(MIS) is the Information System (IS) designed to provide reports to managers for tracking operations, monitoring and control.

which devices are used in networking

Answers

Answer:

Hub.

Switch.

Router.

Bridge.

Gateway.

Modem.

Repeater.

Access Point.

Explanation:

Analyze and write a comparison of C's malloc and free functions with C++'s new and delete operators. Use safety as the primary consideration in the comparison

Answers

Answer:

The C's malloc and free functions and the C++'s new and delete operators execute similar operations but in different ways and return results.

Explanation:

- The new and delete operators return a fully typed pointer while the malloc and free functions return a void pointer.

-The new and delete operators do not return a null value on failure but the malloc/free functions do.

- The new/delete operator memory is allocated from free store while the malloc/free functions allocate from heap.

- The new/delete operators can add a new memory allocator to help with low memory but the malloc/free functions can't.

- The compiler calculates the size of the new/delete operator array while the malloc/free functions manually calculate array size as specified.

Write a loop that subtracts 1 from each element in lowerScores. If the element was already 0 or negative, assign 0 to the element. Ex: lowerScores = {5, 0, 2, -3} becomes {4, 0, 1, 0}.Sample program:#include using namespace std;int main() { const int SCORES_SIZE = 4; vector lowerScores(SCORES_SIZE); int i = 0; lowerScores.at(0) = 5; lowerScores.at(1) = 0; lowerScores.at(2) = 2; lowerScores.at(3) = -3; for (i = 0; i < SCORES_SIZE; ++i) { cout << lowerScores.at(i) << " "; } cout << endl; return 0;}Below, do not type an entire program. Only type the portion indicated by the above instructions (and if a sample program is shown above, only type the portion.)

Answers

Answer:

Replace <STUDENT CODE> with

for (i = 0; i < SCORES_SIZE; ++i) {

       if(lowerScores.at(i)<=0){

           lowerScores.at(i) = 0;

       }

       else{

           lowerScores.at(i) = lowerScores.at(i) - 1;

       }  

   }

Explanation:

To do this, we simply iterate through the vector.

For each item in the vector, we run a check if it is less than 1 (i.e. 0 or negative).

If yes, the vector item is set to 0

If otherwise, 1 is subtracted from that vector item

This line iterates through the vector

for (i = 0; i < SCORES_SIZE; ++i) {

This checks if vector item is less than 1

       if(lowerScores.at(i)<1){

If yes, the vector item is set to 0

           lowerScores.at(i) = 0;

       }

       else{

If otherwise, 1 is subtracted from the vector item

           lowerScores.at(i) = lowerScores.at(i) - 1;

       }  

   }

Also, include the following at the beginning of the program:

#include <vector>

3. Answer the following questions.
a. How does computer number system play
calculations?
a vital role in a
computer​

Answers

Answer:

Computers use the binary number system to store data and perform calculations.

Explanation:

what are the types of slide show in powerpoint? define.​

Answers

Answer:

normal view

slide sorter view

master view

notes page view

Other Questions
Given this reaction: 4K(s) + O2(g)2K2O(s). Calculate how many grams of product is produced if 2.50 g of each reactant is reacted.PLEASE HURRY!!! PLZ HELPHow did Catholic leaders encourage change during the Catholic Reformation?a through a return to simonyb through a return to community servicec with a break from the sacramentsd with a break from church expansion What are the methods involved when you engage on a debate? plz helpto anyone who actually knows can you explain to me the participles, im learning and am very stupid. Hey again.. Please answer!! what is the physical state of caesium at 35c? Explain why What are examples of common computer hardware problems? Check all that apply.Pages from a printer come out blank.Programs freeze or quit unexpectedly.The monitor goes blank or turns black.The keyboard keys get stuck or fall off.The pointer for the mouse moves freely.The computer crashes or reboots itself. You are given the following information about y and x. Y X Dependent Independent Variable Variable 5 15 7 12 9 10 11 7The least Squares of b1 equals?a) -0.7647b) -0.13c) 21.4d) 16.412The least squares estimate of bO equals?a) -7.647b) -1.3c) 21.4d) 16.41176The sample correlation coefficient equals:__________a) -86.667 b) -0.99705c) 0.9941d) 0.99705The coefficient of determination equals:__________a) -0.99705b) -0.9941c) 0.9941d) 0.99705 a visual aid that demonstrates the chain of command at a company, organization, orinstitution? 2.How did George Washington help his troops be successful in battle? A tennis ball is beaten downward with an initial speed of 5 m/s.How fast, in m/s, is the ball falling after 3 seconds (neglect airfriction, so g = 9.8 m/s2)?a 34.4b 34.4C 9.8d 9.8e 5 Choose the following ratios as a fraction: 20 correct out of 25 problems (three are correct)20/2540/6080/1006/74/5 What is insulin and why do people with Type 1 diabetes need it to survive? Question 9 of 20Which group was opposed to the draft?A. Working-class menB. Men of the border statesC. Wives of draft-age menD. Farmers of the MidwestASAP What 3 factions are fighting with each other as a result of thehigh unemployment (6 million) in Germany in 1932? HELP ME PLEASE READ THE EXCERPT !! What is the slope of the line that passes through the points (2, 6) and (-1, -9). Which of the following is a similarity between a republic and a direct democracy?A. Both choose candidates to represent people.B. Both give sovereign power to the states.C. Both give a dictator absolute power.D. Both allow the people to make decisions in their government. The sum of four times a number and negative three is twelve. What is the number?2 1/43 3/4-2 1/46 What are the causes of soil erosion Submit the story you wrote from one of the other character's point of view. At the end of the story, answer the question:How did the story change when another character told the story?WRITER