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

Write a code for function main, that does the following: creates a variable and assign it the value True. uses a while loop which runs as long as the variable of the previous step is True, inside the while loop, get three integer numbers n1, n2 and n3 from the user and

Answers

Answer:

def main():

   is_true = True

   while is_true == False:

       try:

           num1 = int(input("Enter first number: ")

           num2 = int(input("Enter second number: ")

           num3 = int(input("Enter third number: ")

       except ValueError:

           print("Input must be an integer number")

       is_true = bool(input("do you want to end loop? True/False: "))

main()

Explanation:

The python main function above continuously creates three integer numbers in a while loop statement until a false input is received from the user.

) Printers today have many features that include improved quality, photo printing capabilities, digital camera connectivity, built-in flash memory card readers, wireless connectivity, and faster speed. Suppose you are in the market for a new personal printer. Make a list of the most important features needed to meet your needs, and then research printers to identify the best printer for your needs. Be sure to consider both the price of the printer and the price of consumables (such as paper and ink/toner) in your evaluation process. (3 marks)

Answers

Explanation:

Some of the most important features needed in a printer are:

fast printing speedsupport wireless connectivitysupport colored/uncolored printinginclude improved text quality,improved photo printing capabilities

Based on market prices available on the Amazon website, a printer with the above capabilities start at a price range of at least $80.

_______________ is a computer networking protocol used by hosts to retrieve IP address assignments.

Answers

Answer:

DHCP

Explanation:

stands for dynamic host configuration protocol and is a network protocol used on IP networks where a DHCP server automatically assigns an IP address and other information to each host on the network so they can communicate efficiently with other endpoints.

2. Use the correct membership operator to check if "banana" is not present in the fruits object
fruits = ["mango", "orange") if
"banana"
fruits:
print("Yes, apple is a fruit!")​

Answers

Answer:

if not "banana" in fruits:

Explanation:

Given the code segment

Required

Fill in the missing blank

Literally, membership operators are used to check the membership of an item in lists, tuples, strings, etc.

The given code segment defines a list named fruits with two items.

To check if "banana" is not in fruit, we make use of the following statement:

if not "banana" in fruits:

Which means if banana is not in fruit

Having done that, the complete program would be:

fruits = ["mango", "orange"]

if not "banana" in fruits:

    print("Yes, apple is a fruit!")

What property must be set on a menu item to have the user activate that option by pressing Ctrl C on the keyboard

Answers

Answer:

ShortcutKeys

Explanation:

ShortcutKeys is a term used in computing to describe a combination of two or more keys to perform specific actions in a faster way.

Some shortcut keys have been programmed on the operating system of the computer, while a user can also create some through scripting coding.

For example, Ctrl + B is for Bold, while Ctrl + A is for select all.

Hence, to have the user activate the SHORTCUT option by pressing Ctrl C on the keyboard, a SHORTCUTKEYS property must be set on a menu item

Write a sed command that will display all lines of the birthday file that do not contain the string March. What was the sed command?

Answers

Answer:

sed '/march/{d;}' birthdays.txt > result .txt

Explanation:

sed syntax is basically:

sed '/expression/{command;command;...;}' inputfile > outputfile

First, for the expression part, we use /march/ to match all lines containing that string. Then for the command part, we only use {d} command to delete every matching line found.The third part contains the input file to process, I have named it birthdays.txt, but it could have been any other file needed.Finally "> result .txt" makes the script output to be saved into a file named result.txt

Given two integer arrays, largerArray with 4 elements, and smallerArray with 3 elements. What is the result after this code executes?for = 0; i < 45 ++) { LargerArray) = smallerArray(); A. All of the elements of secondArray will get copied to firstArray. B. Error: The two arrays are not the same size. C. All the elements of firstArray will get copied to secondArray D. Some of the elements of firstArray will get copied to secondArray,

Answers

Answer:

A. All of the elements of secondArray will get copied to firstArray.

Explanation:

The correct iteration code is:

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

largerArray[i] = smallerArray[i];

}

From the question, we understand that the largerArray has a size of 4 elements while the smallerArray has a size of 3 elements

Take for instance largerArray is {1,2,3,4} and smallerArray is {5,6,7}

Next, we analyze the loop

1. for(i =0; i<4;++i) {  --->This iterates from index 0 to index 3

2. largerArray[i] = smallerArray[i]; ---- > This assigns the elements of the smallerArray to largerArray.

However, it should be noted that the smallerArray has a maximum index of 2 while the largerArray has a maximum index of 3

The content of largerArray after the iteration will be:

largerArray = {5,6,7,5}

This is so because,

When i = 0

largerArray[0] = smallerArray[0] = 5

When i = 1

largerArray[1] = smallerArray[1] = 6

When i = 2

largerArray[2] = smallerArray[2] = 7

When i = 3

largerArray[3] = smallerArray[0] = 5

Notice that the last iteration refers to smallerArray[0]; this is so because index 3 do not exist in smallerArray. Hence, the index will be returned to the first index of the smallerArray

Taking largerArray as the firstArray and smallerArray as the secondArray.

We can conclude that option A answers the question because all elements in smallerArray is copied to firstArray

I need some help with this assignment. I'm having difficulty trying come up ideas to use here. Can I get any help?

Here's the question.

Think of three simple tasks where you believe sequence of instruction matters. Is there a way to modify it to where sequence doesn't matter? Find steps in each task where the sequence can be changed and still achieve the desired outcome. Write out the original and modified algorithms AND pseudocode for each task. Write a short paragraph for each task describing the changes in sequence.

Answers

Answer:

Abigail wants to attend a community college.  Suppose x represents the number of credits she takes and y represents her total fees in dollars.  Which of these statements are correct?  Select all that apply.

A.

If tuition amounts to $125 plus $150 per credit, the function that would model this situation is y = 150x + 125.

B.

If tuition amounts to $200 plus $175 per credit, the function that would model this situation is x = 175y + 200.

C.

If tuition amounts to $175 plus $150 per credit, the function that would model this situation is y = 175x + 150.

D.

If tuition amounts to $250 plus $275 per credit, the function that would model this situation is x = 250y + 275.

E.

If tuition amounts to $225 plus $200 per credit, the function that would model this situation is y = 200x + 225.

F.

If tuition amounts to $100 plus $125 per credit, the function that would model this situation is y = 125x + 100.

Explanation:

Need help with 4.7 lesson practice

Answers

Answer: Question 1 is A  Question 2 is C

Explanation:

what is suitable equipment to meet customer needs from
1 stand alone pcs
2 networked pcs
3 servers
4 network equipment
5 operating system
6 application software

Answers

uh i think it’s uh carrot

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

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

A connection between files that allows data to be transferred from one file to another is a _______________________.

Answers

Answer:

Link

Explanation:

A Link is a term often used in computer application, data, or file management, that allows a user to carry out the operation of transferring data or information from one file to another often referred to as a target.

There are two types of major links, these include Symbolic links and Hard links.

Hence, in this case, A connection between files that allows data to be transferred from one file to another is a LINK

90 points can someone please write the code for this (HTML):


A text field to enter your name.

At least three multiple choice questions where only one answer can be chosen.

A word problem with a text area for the user to type in the answer.

At least three different math symbols using correct ampersand notation.

A Submit button at the end of the test.

Comment tags that indicate the start and end of the test.


I need to get this done really soon, please help. I couldn't find any text to HTML sites that included multiple choice and Interactive buttons.

Answers

Answer:

Explanation:

1.

First name:

Last name:

.

2.

What fraction of a day is 6 hours?

Choose 1 answer

6/24

6

1/3

1/6

Submit

</p><p> // The function evaluates the answer and displays result</p><p> function displayAnswer1() {</p><p> if (document.getElementById('option-11').checked) {</p><p> document.getElementById('block-11').style.border = '3px solid limegreen'</p><p> document.getElementById('result-11').style.color = 'limegreen'</p><p> document.getElementById('result-11').innerHTML = 'Correct!'</p><p> }</p><p> if (document.getElementById('option-12').checked) {</p><p> document.getElementById('block-12').style.border = '3px solid red'</p><p> document.getElementById('result-12').style.color = 'red'</p><p> document.getElementById('result-12').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> if (document.getElementById('option-13').checked) {</p><p> document.getElementById('block-13').style.border = '3px solid red'</p><p> document.getElementById('result-13').style.color = 'red'</p><p> document.getElementById('result-13').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> if (document.getElementById('option-14').checked) {</p><p> document.getElementById('block-14').style.border = '3px solid red'</p><p> document.getElementById('result-14').style.color = 'red'</p><p> document.getElementById('result-14').innerHTML = 'Incorrect!'</p><p> showCorrectAnswer1()</p><p> }</p><p> }</p><p> // the functon displays the link to the correct answer</p><p> function showCorrectAnswer1() {</p><p> let showAnswer1 = document.createElement('p')</p><p> showAnswer1.innerHTML = 'Show Corrent Answer'</p><p> showAnswer1.style.position = 'relative'</p><p> showAnswer1.style.top = '-180px'</p><p> showAnswer1.style.fontSize = '1.75rem'</p><p> document.getElementById('showanswer1').appendChild(showAnswer1)</p><p> showAnswer1.addEventListener('click', () => {</p><p> document.getElementById('block-11').style.border = '3px solid limegreen'</p><p> document.getElementById('result-11').style.color = 'limegreen'</p><p> document.getElementById('result-11').innerHTML = 'Correct!'</p><p> document.getElementById('showanswer1').removeChild(showAnswer1)</p><p> })</p><p> }</p><p>

3.<p> rows="5" cols="30"</p><p> placeholder="type text.">

4. <p>I will display &euro;</p>

<p>I will display &part;</p>

<p>I will display &exist;</p>

5. <input type="submit">

6. This code should be the first code

<!-- This is a comment -->

<p>Start Test.</p>

<!-- Remember to add more information here -->

This code should be the last and at the end of the of the html code

<!-- This is a comment -->

<p>End Test.</p>

<!-- Remember to add more information here -->

Notice: Answers may not be accurate and may be accurate. And pls endeavor to edit any part of the html code.

Compress
00eb:0000:0000:0000:d8c1:0946:0272:879
IPV6 Address

Answers

Answer:

Compress

00eb:0000:0000:0000:d8c1:0946:0272:879

IPV6 Addres

Explanation:

What is the name of the setting that creates a Green Dashed line and allows you to set angular locks when activation

Answers

Answer:

Polar Tracking

Explanation:

Polar Tracking a term or function in AUTOCAD that is used to identify a point closest to a predetermined angle and define a distance along that angle. This helps creates a line (which is a green dashed line). Thereby enabling a user to set angular locks when or during activation.

Hence, in this case, the correct answer to the question is POLAR TRACKING

plsss help me

1)give 2 examples of systems that you use or see in your day-to-day life​

Answers

Answer:

The modern world has numerous kinds of systems that influence daily life. Some examples include transport systems; solar systems; telephone systems; the Dewey Decimal System; weapons systems; ecological systems; space systems; etc.

What is the output of the following statement?
printf("%s", strspn("Cows like to moo.", "Ceiklosw ");
a. 10.
b. 8.
c. e.
d. nothing.

Answers

Answer:

The correct answer is D) Nothing  

Explanation:

This question speaks to the results of programming using C language.

The printf() function is used to print ('character, string, float, integer, octal and hexadecimal values') onto the output screen when programming using C language program.

We use printf() function

with %d format specifier to display the value of an integer variable,

with %c to display character,

With %f for float variable,

with %s for string variable,

with %lf for double and

with  %x for the hexadecimal variable.

Strspn() is often used to calculate the number of identical characters in both string and escape, whether the str1 does not match the str2 characters.

If the above statement is cued into a c compiler, it will thus return an error.

Cheers

When you read in data from a file using the read() method the data is supplied to Python in the form of:
A. A list of Strings
B. A String
C. A list of lists
D. Raw ASCII values

Answers

Answer:

B. A String

Explanation:

Remember, there are other methods or ways to read data from a file such as readlines(), and the for ... in loop method.

However, if you read in data from a file using the read () method the data would be supplied to Python in the form of a String (or single String). This is the case because a String supports only characters, unlike lists that could contain all the data types.

Using the read() method in python is used to read in files such as text files, csv and other file types. The read() method will render the read in data as as a string.

In general, the read in data from the file is supplied in the form of a string, however, depending on the version of python which is being used, the string type may vary.

When using python 2, the data is supplied as a bytestring while the data is supplied a unicode string in python 3.

Hence, the read() method renders data as a string.

Learn more : https://brainly.com/question/19973164

What is a contact position ?

Answers

Answer:

the poses that connect the extremes in motion

Explanation:

Consider the use of 1000-bit frames on a 1-Mbps satellite channel with a 270-ms delay. What is the maximum link utilization for,
a. Stop-and-wait flow control?
b. Continuous flow control with a window size of 7?
c. Continuous flow control with a window size of 127?

Answers

i feel as if it would be B.

The _________ operator returns the distance in bytes, of a label from the beginning of its enclosing segment, added to the segment register.a) TYPEb) SIZEOFc) OFFSETd) LENGTHOFe) PTR

Answers

Answer:

C. Offset.

Explanation:

An offset operator can be defined as an integer that typically illustrates or represents the distance in bytes, ranging from the beginning of an object to the given point (segment) of the same object within the same data structure or array. Also, the distance in an offset operator is only valid when all the elements present in the object are having the same size, which is mainly measured in bytes.

Hence, the offset operator returns the distance in bytes, of a label from the beginning of its enclosing segment, added to the segment register.

For instance, assuming the object Z is an array of characters or data structure containing the following elements "efghij" the fifth element containing the character "i" is said to have an offset of four (4) from the beginning (start) of Z.

An IT suspects that an unauthorized device is connected to a wireless network. This is a result of pastry sharing on a device brought from home. What is put in place to stop such activity.

1- Media Access Control Filtering

2- Channel Overlap

3-WiFi Protected Access 2

4- collision Domain

Answers

Answer:

3. WiFi Protected Access 2

Explanation:

Given that Wi-Fi Protected Access 2 often referred to as WAP 2 is a form of computer security or privacy measure to ensure that Wireless networks are furnished with powerful security of data network access control.

Hence, when a user employed or utilize WPA2. It gives such a user a high degree of maximum certainty of controlling the users that can have access to his wireless network.

Hence, in this case, what is put in place to stop such activity is Wi-Fi Protected Access 2

(Decimal to binary) Write a recursive method that converts a decimal number into a binary number as a string. The method header is public static String dec2Bin(int value) Write a test program that prompts the user to enter a decimal number and displays its binary equivalent.

Answers

Answer and Explanation:

import java.util.Scanner;

public class convertToBinary {

public static String declToBin(int value){

if(value == 1){

return declToBin((value/2) + "" + (value%2);

}

else{

declToBin((value/2) + "" + (value%2);

}

}

public static void main(String args[]){

int number;

Scanner change = new Scanner(System.in);

System.out.print("Enter decimal value: ");

number = change.nextInt();

System.out.println(declToBin(number));

}

}

The recursive function declToBin(int value) keeps executing code until value==1. Recursive functions reduces lines of code and makes it more efficient.

Note: Decimal is number in base 10(denary). To convert a decimal number to base 2(binary), we keep dividing the decimal number entered by the user by 2 until the result is zero(when the number divided is one)

We use the Java programming language here. First we import the Scanner object(import.java.util.Scanner). We use the method nextint() from the object to convert the string value entered by the user to int value( because our declToBin function takes an int parameter).


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 ?

Write a program that asks the user to input their first and last names. The first prompt should state:

Please input your first name:
The second prompt should state:

Please input your last name:
After accepting the inputs, your program should output the input in the form last name, first name.

Hint: Remember that you can concatenate (add) two phrases by using the + symbol. Don't forget that you'll need to add a comma as well and that the comma must be followed by a space.

Answers

first = input("Please input your first name: ")

last = input("Please input your last name: ")

print(last+", "+first)

I hope this helps!

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

Daiki is creating a database for a paint store. Each color of paint would have its own record which will include the color name price and size. The price of the paint will be in its own a) table b) file c) field d) format

Answers

Answer:

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

Explanation:

The correct answer to this question is c)field.

As we know that the feature of an entity is represented by its attribute in the database table. A database table is a set of records of different fields. Each field represents a row in a database table. Each field can contain a set of attributes related to an entity such as a paint color.

So the price of paint will be in its own field. Because there are different colors in the database table. Each color has its own record in form of a field. As you know that each field is a row in the database table. So, each row has the price of a paint color.

Other options are not correct because:

The table contains a list of fields and each field contains its own paint price. The format and file is something different and does not have any relation with the question scenario.

Answer:

C) Field

Explanation:

I took the test

A computer is using a fully associative cache and has 216 bytes of memory and a cache of 64 blocks, where each block contains 32 bytes.

Required:
a. How many blocks of main memory are there?
b. What is the format of a memory address as seen by the cache, that is, what are the sizes of the tag and offset fields?
c. To which cache block will the memory address F8C9 (subscript) 16 map?

Answers

1) The number of blocks of main memory that are there are;

2^16/32 = 2^16/2^5 = 2^11

2) The format of a memory address as seen by the cache,that is the sizes of the tag and offset fields are;

16 bit addresses with 11 bits also in the tag field and the 5 bits in the word field.

3) The cache block that the memory address F8C9 (subscript) 16 map;

Since it is an associative cache, it can actually map anywhere.

That is, it has the ability of mapping anywhere.

Read the following statements and select the
conditional statements. Check all that apply.
If my car starts, I can drive to work
It is inconvenient when the car does not start.
If my car does not start, I will ride the bus to
work
I purchased this car used, and it is not
reliable

Answers

if my car starts, i can drive to work

if my car does not start, i will ride the bus to work

Answer:

if my car does not start, i will ride the bus to work

if my car starts, i can drive to work

Explanation:

Other Questions
PLZZZZ HELP Find lyrics to MAMA CRY by YNW MELLY. Identify the following: song writers tone, figurative language, and sound devices. Create a key for your annotations. what are the three products of celullar respiration Increase 180 by 12.5% TEAM HANDBALLIf the ball just partly touches the boundary line, it is considered out.(true or false?) 2. What properties do all acids have?3. Why should you never use taste as a method for testing an unknown substance?4. What is used to detect the presence of acids?10. What can you use to detect the presence of a base? 11. What are some common bases that we use every day?12. How does an antacid help reduce heartburn?13. What happens when acid and base are mixed14. What is used to determine the pH of a substance?15. Describe how the pH scale works. In other words, what is it actually measuring?17. Why is pH important to our environment?18. Describe how salt is formed.Pls help!!!!! If you lived in Mesopotamia between 3500 BCE and 300 BCE, how might the Tigris and Euphrates rivers have impacted your daily life? The map might help support your thinking. Write or draw your response in the box below. Answer the following parts asked. A repeated back and forth or up and down motion is called a help im being timed what is the perimeter of this triangle?! How can forces be used to predict the movement of objects?Think in terms of objects experiencing forces in opposite directions. PLEASE HELP ME !!!!!!! what ancient religon had social hiearchey Consider the following. cos(x) = x3 A) Prove that the equation has at least one real root. The equation cos(x) = x3 is equivalent to the equation f(x) = cos(x) x3 = 0. f(x) is continuous on the interval (0, 1) there is a number c in (0, 1) such that f(c) = 0 by the Intermediate Value Theorem. Thus, there is a root of the equation cos(x) = x3, in the interval (0, 1). B) Use your calculator to find an interval of length 0.01 that contains a root. When the ventricular myocardium receives an electrical impulse, it stimulates acontraction that:only pulls in deoxygenated blood from the body.O pushes both types of blood to both the lungs and body.only pushes deoxygenated blood to the lungs.only pulls in oxygenated blood from the lungs. Choose the following ratios as a fraction: 3 out of 4 games won (2 are correct)3/475/100100/754/3 Can somebody help pleaseExplain how incontinence issues can be transient? #12: Kara is deciding between The Lyme Point Inn and Ever After Farms for 1 pointher wedding reception. The Lyme Point Inn charges $3,000 for the venueand $100 for each meal. Ever After Farm charges $5,400 for the venue and$70 for each meal. Write and solve an equation to find the number ofmeals at which the total cost charged by the two venues would be thesame. *Your answerooo The photo shows two yeast cells. Each cell is an individual organism. Which sentence best describes what happened to each cell during cell growth?A. It will become many different cells.B. It will produce offspring with a mate.C. It will divide in half to form two new cells.D. It will become larger by taking in nutrients. 7925 divided by 25 can you help If you saw two college students throwing rocks through the windows oftheir high school at night, would you report the students to the police? Whyor why not? Suppose you saw two friends throwing rocks through thewindows of a neighbor's home. Would you report your friends to the police?Why or why not? Did you answer both questions the same way? If not,explain why.