Question

PLEASE LET ME KNOW IF I'M RIGHT: A. 5*Math.random()                           integer   OR   real &n

PLEASE LET ME KNOW IF I'M RIGHT:

A. 5*Math.random()                           integer   OR   real          smallest possible = 0.0       

largest possible =    4.999   

B. Math.floor(Math.random()+1)        integer   OR   real          smallest possible = 0          

largest possible = 1             

C. Math.ceil(3*Math.random())+10    integer   OR   real          smallest possible = 3          

largest possible =   10             

0 0
Add a comment Improve this question Transcribed image text
Answer #1

basics Math.random()  will generate number between 0 - 1

A. 5*Math.random()                        

result will be real number

smallest possible = 0.00000001 but not zero exactly

largest possible =    4.999   

B. Math.floor(Math.random()+1)        

integer

smallest possible = 1          

largest possible = 1     

always 1 the above code generate numbers 1.0 to 1.9 so .. math of floor number is 1

C. Math.ceil(3*Math.random())+10   

integer

smallest possible = 11

largest possible =   13

Add a comment
Know the answer?
Add Answer to:
PLEASE LET ME KNOW IF I'M RIGHT: A. 5*Math.random()                           integer   OR   real &n
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Please let me know if this is right. In Figure A (Below). Which of the following...

    Please let me know if this is right. In Figure A (Below). Which of the following rock layers is the OLDEST? I O A. A OB.B OC.C Reset Selection

  • hello please let me know if im on the right track. also help with the rest...

    hello please let me know if im on the right track. also help with the rest 5) The compound below contains an electronhilic carbon atom. Show the reaction of this ma with a nucleophile of your choice but make sure you cenerate a chiral center. Use curved on to indicate the flow of electrons, show charees where applicable and consider stereochemistry Finally, identify the configuration of the newly generated chiral center. (8 pts.) :CEN

  • This is java. Please let me know about those code. Please do not use array and...

    This is java. Please let me know about those code. Please do not use array and scanner. Just do by loop. // a) Task: Find the sum of all multiples of 3 and 5 less than 1000. // b) Task: Given two integers k and n, print out every multiple of k less than n // c) Task: Given an integer n, print out k^k for every k=1...n // d) Task: Write a function called "factorProduct" that takes as input...

  • please let me know if I for these right or please help me corrext them thanks...

    please let me know if I for these right or please help me corrext them thanks 36. The physician orders morphine 4 mg IV push g4 tor paih. The medication is supptied in (or 5mg/2 mL. Administer over 4 minutes How mahy mililiters will the nurse sdminist How many millliters will you give per minute? S" 3 The physician orders 30 mg of medication duted in 100mL of D, W glven over )-3. minutes IV. The How many milliliters will...

  • this is for real analysis. please be specific in proofs 4, Let I'm : R →...

    this is for real analysis. please be specific in proofs 4, Let I'm : R → R be defined as f,1-1 cos(z-n), (a) Let f(z)-lini fn (r). Determine f(a) forz E R and justify your result. [Be sure that your justification also establishes that fla) is defined for rER. (b) Does fn(x) converge uniformly to f(ar) on R? Prove your result.

  • Please let me know if I answered correctly, if not please explain the problem. 4. The...

    Please let me know if I answered correctly, if not please explain the problem. 4. The retention by students of material learned earlier is given by R(t) = 82 – 15 In (10+4 + 1), where t is time in weeks since the material was taught and R is the percent of materia retained. Find the RATE of retention after 5 weeks. (Hint: Rate of retention is the derivative.) Use good calculus notation and answer with a sentence. I R(t)...

  • Can't figure out the rest. Please let me know if I'm doing the rest right. PRINTER...

    Can't figure out the rest. Please let me know if I'm doing the rest right. PRINTER VERSION 4 BACK NEXT KES Question 2 Pearl Ltd. is a Canadian publicly-traded business with a December 31 fiscal year end. In order to get a better return on some of its excess cash, Pearl purchased 110 common shares of AFS Corporation on July 1, 2020 ata price of $5 per share. Due to the nature of the investment Pearl's management is accounting for...

  • Can you please check my work and let me know if I did this right? PCB...

    Can you please check my work and let me know if I did this right? PCB 3063L ProBof or aAs 1:2:1 10. In humans, the rh factor is inherited as a dominant gene (R). Individuals with this llele are referred to as rh positive. Two (2) heterozygous individuals (Rr) decided to reproduce. What is the probability of four (4) rh positivechildrenzu- a. b. What is the probability of four (4) rh negative boys? [1] nuy prop r 0.02% nue rc....

  • let me know which one is (aq) (s) (I) ( g) Use the References to access...

    let me know which one is (aq) (s) (I) ( g) Use the References to access important values if needed for this question. Enter electrons as e Use smallest possible integer coefficients. If a box is not needed, leave it blank. For the following electron-transfer reaction: Mg(s)+ Cl2(g) Mg2 (aq) + 2Cr(aq) The oxidation half-reaction is: + + The reduction half-reaction is: + + Submit Answer Retry Entire Group 2 more group attempts remaining T Enter electrons as e. Use...

  • Python Script format please! 1. Write a script that takes in three integer numbers from the...

    Python Script format please! 1. Write a script that takes in three integer numbers from the user, calculates, and displays the sum, average, product, smallest, and largest of the numbers input. Important things to note: a. You cannot use the min() or max() functions, you must provide the logic yourself b. The calculated average must be displayed as an integer value (ex. If the sum of the three values is 7, the average displayed should be 2, not 2.3333). Example:...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT