Which of the following is the best for generating random integer 0 or 1?

a. (int)Math.random()
b. (int)Math.random() + 1
c. (int)(Math.random() + 0.5)
d. (int)(Math.random() + 0.2)
e. (int)(Math.random() + 0.8)

c. (int)(Math.random() + 0.5)

Computer Science & Information Technology

You might also like to view...

?Identify the CSS3 3D transformation function that shifts an object offX pixels horizontally, offY pixels vertically, and offZ pixels along the z-axis.

A. ?translate3d(offX, offY, offZ) B. ?perspective(p) C. ?rotate3d(offX, offY, offZ, angle) D. ?scale3d(offX, offY, offZ)

Computer Science & Information Technology

A Case structure is used most often when conditions are treated separately.

Answer the following statement true (T) or false (F)

Computer Science & Information Technology