Computer Networking: A Top-Down Approach (7th Edition)
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN: 9780133594140
Author: James Kurose, Keith Ross
Publisher: PEARSON
Bartleby Related Questions Icon

Related questions

Question

Instruction:

Please write this code in javascript and let me know if there is any issue

Question:

1. Use our HTML template to create a file named as your name (for example if your name is john the file name would be "john.html"). Make sure to update the metadata (title, author, description...) accordingly. This HTML file should contain an h1 heading element that includes your full name and student number.

 2. Create an empty element with an id of your name. This element should be used to display your output from JavaScript. 

3. Create a JavaScript file named your studentid.js that performs the following: 

 

a. Create a function that will count the number of even numbers contained in the array that is passed to this function. The array may contain values of any type, but you only count the even numbers. This function will return a number (number of instances of even numbers found in the array). Needless to say, the function will return zero, if the array is empty or no even numbers are found. 

Note: The function does not display any output, nor does it return a string. Only the value of your counter is returned.

 b. Call your function at least three times, passing an array with different content, and display a message for each call, as shown in the example below. Display each result as a separate h2 element inside the div element (created in your HTML): 

"let evenNums = countEvenNumbers([ , 33, 4, "Hi", 5, 66, "no"]); "

Your output will be: 2 even numbers were found.

 You will need to call your function two more times, passing an array that contains different values and displaying the results of those calls in a similar manner (as in the example shown above).

Expert Solution
Check Mark
Knowledge Booster
Background pattern image
Similar questions
SEE MORE QUESTIONS
Recommended textbooks for you
Text book image
Computer Networking: A Top-Down Approach (7th Edi...
Computer Engineering
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:PEARSON
Text book image
Computer Organization and Design MIPS Edition, Fi...
Computer Engineering
ISBN:9780124077263
Author:David A. Patterson, John L. Hennessy
Publisher:Elsevier Science
Text book image
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:9781337569330
Author:Jill West, Tamara Dean, Jean Andrews
Publisher:Cengage Learning
Text book image
Concepts of Database Management
Computer Engineering
ISBN:9781337093422
Author:Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:Cengage Learning
Text book image
Prelude to Programming
Computer Engineering
ISBN:9780133750423
Author:VENIT, Stewart
Publisher:Pearson Education
Text book image
Sc Business Data Communications and Networking, T...
Computer Engineering
ISBN:9781119368830
Author:FITZGERALD
Publisher:WILEY