how can i generate randomly double numbers

1. Write a program that randomly fills a 10x4 Course array with the grades of 10 students (type double), where each column in array Course represents the grade of Midterm 1 (25%), Midterm 2 (25%), Homework (10%) and Final exam (40%), respectively. The range of first and second column is [0.0 – 25.0], the third column is [0.0 – 10.0] and the fourth column is [0.0 – 40.0]. Find and print the total grade for each student, and the maximum grade of Midterm 1, Midterm 2, Homework and Final exam using the following methods:

• finalGrades(double Course[][], double Total[]) : this method finds the total grades of each student and stores the result in a one dimensional array Total. Print the content of array total in main method.

• maximum(double Course[][]) : this method finds and prints the maximum grade of Midterm 1, Midterm 2, Homework and Final exam.
Sample output
The grades of 10 students are:
6.30 1.38 9.78 9.54
23.44 5.37 6.86 10.61
5.37 11.75 1.41 13.74
12.21 24.58 0.31 39.74
4.66 1.80 5.08 38.39
0.28 17.71 8.36 34.87
0.91 2.28 6.10 31.62
13.39 17.76 8.61 9.54
11.80 3.52 1.74 38.48
14.33 23.07 3.72 37.49
The total grades for each student:
Student 1: 27.00
Student 2: 46.27
Student 3: 32.27
Student 4: 76.84
Student 5: 49.92
Student 6: 61.22
Student 7: 40.91
Student 8: 49.30
Student 9: 55.54
Student 10: 78.62
The maximum grade of Midterm 1 is 23.44
The maximum grade of Midterm 2 is 24.58
The maximum grade of Homework is 9.78
The maximum grade of Final Exam is 39.74

What's the problem / question ?
Topic archived. No new replies allowed.