The code segment below is intended to randomly print one of the values 2, 4, 6, or 8 with equal probability.
int val = /* missing code */ ;
val *= 2;
System.out.print(val);
Which of the following can be used to replace /* missing code */ so that the code segment works as intended?
a. Math.random() * 4 + 1
b. Math.random() * 8
c. (int) (Math.random() * 4)
d. (int) (Math.random() * 4 + 1)
e. (int) (Math.random() * 8 + 1)