Create an empty element with an id of your name. This element should be used to display your output from JavaScript. Create a JavaScript file with studentid.js and link it to your HTML file created above. Perform following exercise in your JavaScript file: a. Declare an empty array that will be used to store integer numbers. b. Write a loop that iterates 30 times. In each iteration of the loop, generate a new random number between 0-50 and insert the value in your array (created above). c. After exiting your loop, display content of your array in an h2 element inside the div element created in your HTML document, where array elements are separated by double quote ". d. Loop through your array and count the instances of number 7 and 9 found in your array. As you are looping through the array, also replace each instance of number 3 by your first name. e. After exiting the loop, display result in an h3 element, as shown in example below: Number 7 was found 2 times and number 9 was repeated 4 times in this array f. Display content of your array (separated by comma) in a new h2 element in the div element in your HTML document.

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

WRITE THIS PROGRAM USING HTML AND JAVASCRIPT

 

Create an empty <div> element with an id of your name. This element should be used to display your
output from JavaScript.
Create a JavaScript file with
studentid.js and link it to your HTML file created above. Perform
following exercise in your JavaScript file:
a. Declare an empty array that will be used to store integer numbers.
b. Write a loop that iterates 30 times. In each iteration of the loop, generate a new random number
between 0-50 and insert the value in your array (created above).
c. After exiting your loop, display content of your array in an h2 element inside the div element
created in your HTML document, where array elements are separated by double quote ".
d. Loop through your array and count the instances of number 7 and 9 found in your array. As you are
looping through the array, also replace each instance of number 3 by your first name.
e. After exiting the loop, display result in an h3 element, as shown in example below:
Number 7 was found 2 times and number 9 was repeated 4 times in this array
f. Display content of your array (separated by comma) in a new h2 element in the div element in your
HTML document.
Transcribed Image Text:Create an empty <div> element with an id of your name. This element should be used to display your output from JavaScript. Create a JavaScript file with studentid.js and link it to your HTML file created above. Perform following exercise in your JavaScript file: a. Declare an empty array that will be used to store integer numbers. b. Write a loop that iterates 30 times. In each iteration of the loop, generate a new random number between 0-50 and insert the value in your array (created above). c. After exiting your loop, display content of your array in an h2 element inside the div element created in your HTML document, where array elements are separated by double quote ". d. Loop through your array and count the instances of number 7 and 9 found in your array. As you are looping through the array, also replace each instance of number 3 by your first name. e. After exiting the loop, display result in an h3 element, as shown in example below: Number 7 was found 2 times and number 9 was repeated 4 times in this array f. Display content of your array (separated by comma) in a new h2 element in the div element in your HTML document.
Expert Solution
steps

Step by step

Solved in 3 steps with 4 images

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