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
mars1129 [50]
3 years ago
5

Write a function named countEvens that counts and returns the number of even integers in an array. The function must have this h

eader: function countEvens(list) For example, if the countEvens function were called like this: var list = [ 17, 8, 9, 5, 20 ]; var count = countEvens(list); The countEvens function would return 2 because 8 and 20 are even integers.

Computers and Technology
1 answer:
skelet666 [1.2K]3 years ago
4 0

Answer:

function countEvens(list) {

   // IMPLEMENT THIS FUNCTION!

var even = [];

 

for(var i = 0; i < list.length; i++){

 if (list[i] % 2 == 0){

   even.push(list[i]);

   

 }

}

 return console.log(even)

}

var list = [ 17, 8, 9, 5, 20 ];

var count = countEvens(list);

Explanation:

The programming language used is JavaScript.

An even variable is initialized, to hold  the even variables within list.

A FOR loop loop iterates through all the elements in the list, an IF statement is used to check using the modulo division to check if the elements in the list are even.

The even elements are appended to the even list using .push() method.

Finally, the function returns the even list and outputs the list to the log using console.log(even) .

A list is created and the function is called.

You might be interested in
How is the EF​ computed? A. ES​ + Activity time B. LF minusActivity time C. ​Min{LS of all immediate following​ activities} D. ​
densk [106]

Answer:

The answer is "Option A".

Explanation:

To signify that the properties must be mapped in a calculated column is always used Entity Framework. It is a Core Fluent API, that is used in the SQL procedure, and the term ES stands for "Early Start", in which it is an approximate time to start any exercise. It is also known as an activity, that will only start with the near then ends, and all past track practices have begun early, and certain options were wrong, that can be defined as follows:

  • In option B,  It requires unit time 0, that's why it is wrong.
  • Option C and Option D both are wrong because, in LF, it requires unit time, that is equal to 0 so, it can't be min or max.
6 0
4 years ago
If someone you don’t know asks where you go to school, what should you do
My name is Ann [436]

Answer:

Don't answer him because you don't know what he is going to do

8 0
3 years ago
A database on a mobile device containing bands, sub-bands and service provider IDs allowing the device to establish connection w
VashaNatasha [74]

Answer:

A. PRL

Explanation:

Mobile phone technologies like CDMA , GSM etc, are used by cell/ mobile phone to transmit and receive signals. With the limitation of fluctuation, a mobile phone was made to adapt to this problems, thereby combining this broadbands like CDMA, GSM,4G LTE etc gave rise to PRL (Preferred roaming list) database to hold information needed to establish connection to the correct cell tower for these broadbands.

3 0
4 years ago
A slide in Olivia's presentation has the Title and Content layout applied. The bulleted list on the slide contains 14 items and
Harrizon [31]

Answer:

1) Right-click the slide, select Layout, and select Two Content

2) <em>*While on the same slide* </em>-go to the Ribbon, select Layout and select Two Content.

Explanation:

Either of these options will change the layout of the slide. After this is done, select 8-14 and cut and paste them in the second text box. Then format them to look aesthetically pleasing.

8 0
4 years ago
A system with an availability of 99.999% can be down for a maximum of 52 minutes per year.
rjkz [21]
False. Just calculate what those five mins mean. And remember in percents so you have to divide by an extra 100

Five-nines or 99.999% availability means 5 minutes, 15 seconds or less of downtime in a year. Or, if you are really ambitious, shoot for six nines or 99.9999% availability, which allows 32 seconds or less downtime per year.
5 0
3 years ago
Other questions:
  • What finacial behaivor will typically lead to a low credit score
    8·1 answer
  • PLS HELP ASAP! WILL GIVE BRAINLIEST!
    14·1 answer
  • Technician A says that as volume decreases, pressure increases. Technician B says that as temperature increases, pressure decrea
    5·1 answer
  • Okay I need help. In the first picture, the black glasses, that was my vision last year 52:17 135 and my vision now is 52:15 135
    5·1 answer
  • The crash rate per mile is ..
    12·2 answers
  • A program executes 100 billion instructions. It executes on an IBM processor that has an average CPI of 1.2 and a clock frequenc
    15·1 answer
  • Programmers refer to programs that contain meaningful names as ____. AnswerThe answer is: Programmers refer to programs that con
    12·1 answer
  • AI in processing capability of computer yes or no​
    13·2 answers
  • Use the factorial operation to evaluate 4!.<br><br> 24<br><br> 1<br><br> 4<br><br> 10
    10·1 answer
  • Who is known as the first computer programmer?​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!