I'm trying to set random values to an array using Math.Random(), but it is printing values with 15 decimal places when I only want 2. How do I fix this?
This is what I have so far it works and gives me values like:
[9.410800457889598, 7.816378845915057, 7.4315520333161995, 7.4844070010512285, 7.6640924183174945].
public static void populateArray(double[] judge){
for(int n=0;n<=4;n++){
double score =(Math.random()*(3)+7);
judge[n] = score;
}
}