Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

pls do Question 1 and 2 using JavaScript 01. Given the data below: -34, -73, 19, 63, -55, -61, 65, -14, -19, [54, -16, 80,

image text in transcribedpls do Question 1 and 2 using JavaScript

01. Given the data below: -34, -73, 19, 63, -55, -61, 65, -14, -19, [54, -16, 80, 55, -74, 73, 26, 5, -51, -17, -25] Determine if each item in the array is either a positive odd number or negative even number and add it an appropriate array (positive odd or negative even). You should print each array of numbers (positive odd or negative even) to the output area using one statement for each list. You must not hard-code the solution but figure it out mathematically. check if there is a remainder after division of a number Hint: You can use the modulo (%) operator by another. Expected output: Positive Odd: 73, 5, 19, 63 Negative Even: -16, -74, -34, -14 02. The following expression returns a random number between 1 and 6 inclusive i.e. it simulates a die (singular of dice) Math.floor( (Math.random() * 6) + 1) Use this expression to simulate rolling a die 60,000 times and display the frequency with which each face of the die finishes uppermost. Use 6 variables to capture the frequencies and a 6-way nested if ... else... control structure to increment them appropriately. Display the results neatly in your output area. Note your frequencies for the rolls will be different. Sample output: Frequency of die rolls 1: 10128 2: 10060 3: 9868 4: 10029 5: 9946 6: 9969

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

Databases And Python Programming MySQL MongoDB OOP And Tkinter

Authors: R. PANNEERSELVAM

1st Edition

9357011331, 978-9357011334

More Books

Students also viewed these Databases questions