/**
*
* Jo Shwang
* nine october anno domini two-thousand and seventeen
*
*/
import java.util.*;
public class gradebook{
public static void main (String args[]){
int max = -1;
int min = 101;
double mean = 0;
int[] grades = new int[20];
for(int i = 0;i < 20;i++){
grades[i] = (int) ((Math.random() * 41) + 60);
}
for(int i = 0;i < 20;i++){
if(grades[i] > max)
max = grades[i];
if(grades[i] < min)
min = grades[i];
mean += grades[i];
}
for(int i = 0;i < 20;i++){
System.out.println(grades[i]);
}
System.out.println("\nMax: " + max);
System.out.println("Min: " + min);
System.out.println("Mean: " + (mean / 20.00));
}
}
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.