Make a function that does the following: Generates a random number from the interval [0, 1000]. Note:
Question:
Make a function that does the following:
Generates a random number from the interval [0, 1000].
Note: Remember that Math.random() outputs a random number from [0,1]. Do the correspondingmathematical operations to extend the interval to [0,1000].
Prints the generated number using the string concatenation. The printing should have the followingformat:
Randomly generated number: [insert number here]
Displays the ones, tens, and hundreds digit of that number. Use string operations to display thenumbers. The printing should have the following format:
Breakdown: [hundred], [tens], [ones]
Sample output:
Randomly generated number: 458
Breakdown: 400, 50, 8
Note: There are two ways for this. The first is by using mathematical operations to separate theones, tens, and hundreds. The second way is to treat the randomly generated number as string and access thecharacters individually.
Understanding Basic Statistics
ISBN: 9781111827021
6th Edition
Authors: Charles Henry Brase, Corrinne Pellillo Brase