1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
import java.util.Arrays;
public class Blablabla
{
public static void main(String[] args)
{
//String tabNotes = new String(10);
int a = 1 + (int)(100*Math.random());
int b = 1 + (int)(100*Math.random());
int c = 1 + (int)(100*Math.random());
int d = 1 + (int)(100*Math.random());
int e = 1 + (int)(100*Math.random());
int f = 1 + (int)(100*Math.random());
int g = 1 + (int)(100*Math.random());
int h = 1 + (int)(100*Math.random());
int i = 1 + (int)(100*Math.random());
int j= 1 + (int)(100*Math.random());
int moy = (a+b+c+d+e+f+h+i+j) / 10;
// mettre les notes obtenues dans un tableau
int tabNotes[] = {a, b, c, d, e, f, g, h, i, j};
System.out.println("Note1 = " + a);
System.out.println("Note2 = " + b);
System.out.println("Note3 = " + c);
System.out.println("Note4 = " + d);
System.out.println("Note5 = " + e);
System.out.println("Note6 = " + f);
System.out.println("Note7 = " + g);
System.out.println("Note8 = " + h);
System.out.println("Note9 = " + i);
System.out.println("Note10 = " + j);
System.out.println("La moyenne du groupe = " + moy);
//System.out.println("La note la plus forte = " + max + "%");
//System.out.println("La note la plus faible = " + min + "%");
// tri du tableau:
Arrays.sort(tabNotes); // import java.util.Arrays;
int mini = tabNotes[0];
int maxi = tabNotes[9];
System.out.println("La note mini est: " + mini);
System.out.println("La note maxi est: " + maxi);
}
} |