Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

lab2.html Lab 2_2 Lab 2_2 with JavaScript Please follow the steps and answer questions 4-5 in a text file, and question 6 in the JavaScript

image text in transcribed

image text in transcribed

lab2.html

Lab 2_2

Lab 2_2 with JavaScript

Please follow the steps and answer questions 4-5 in a text file, and question 6 in the JavaScript file. 1. Download and extract the lab2_2.html file 2. Open the file in Chrome, right click on the page and select Inspect 3. Select the Console tab. It is OK to see file not found error message for now. 5. You can now refresh the webpage, observe the changes, and continue to type the following code line by line into the console. Click enter after each line the code. let randomNumber = document.getElementById('randomNumber"); let rawRandom = Math.random(); let randomBinary = Math.round(raw Random); randomNumber.innerHTML = 'Your random binary is ' + randomBinary +''; Based on your observations of the output and research, answer the following questions a. [1 point] Explain what the Math.random() does in the second line of code. b. [1 point] Explain what the Math.round() does in the third line of code. c. [1 point] Why can the third line of code generate random binary numbers? d. [1 point] Is it possible to generate other types of random numbers from the second line of code

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

DATABASE Administrator Make A Difference

Authors: Mohciine Elmourabit

1st Edition

B0CGM7XG75, 978-1722657802

More Books

Students also viewed these Databases questions

Question

Explain the steps involved in training programmes.

Answered: 1 week ago