i have a question but am confuse

the question is create and array of random double floating point numbers,calculate and print the sum off all the numbers in the array.truncates all of the numbers in the array up to 7 decimal places and then calculate and print the sum of the truncated numbers.calculate and print the difference between the actual sum of the numbersand the sum of the truncated numbers.the part i understand was how to

then you can use the java.text.NumberFormat class.

double value = 5.9999999999999;

NumberFormat nf = NumberFormat.getInstance();

nf.setMaximumFractionDigits(7);

String displayValue = nf.format(value);

System.out.println(displayValue);

//should print >5.9999999

but i dont kbnow haw to create a random double floating point numbers it just confuse me ,can someon help me out?please