Answer to Question #111890 in Java | JSP | JSF for Flores

Question #111890
What value(s) will be output by the following Java code statements?
System.out.println( Math.random() ); _________________
System.out.println( Math.random() * 3); _________________
System.out.println( (int)(Math.random()*10) + 2);
1
Expert's answer
2020-04-24T11:34:51-0400

System.out.println( Math.random() ); --> numbers ranging from 0.0 to 1.0 (double)

System.out.println( Math.random() * 3); --> numbers ranging from 0.0 to 3.0 (double)

System.out.println( (int)(Math.random()*10) + 2); --> numbers ranging from 2 to 10 (int)



Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS