uhrand
Messages postés491Date d'inscriptionsamedi 20 mai 2006StatutMembreDernière intervention15 juillet 20129 1 févr. 2009 à 17:57
Comme ça le programme fonctionne chez moi:
public class adnanchair {
static int i, n;
static float programmation[] = new float[n];
static float instalation[] = new float[n];
static float bereautique[] = new float[n];
static float français[] = new float[n];
static float anglais[] = new float[n];
static float arabe[] = new float[n];
static float moyenne[] = new float[n];
static String nom[] = new String[n];
static String prenom[] = new String[n];
static String classe[] = new String[n];
static String fillier[] = new String[n];
static String code[] = new String[n];
static String mention[] = new String[n];
public static void main(String[] args) {
int r;
do {
System.out.println("**faite votre choix**");
System.out.println("1-Ajouter Etudiante");
System.out.println("2-Afficher les information");
System.out.println("3-Calculer le moyenne");
System.out.println("4-Afficher la Mention");
System.out.println("5-Afficher le bulletin");
System.out.println("6-Fermmer le programme");
r = Lire.entierInt();
switch (r) {
case 1:
ajouter();
break;
case 2:
afficher();
break;
case 3:
moyenne();
break;
case 4:
mention();
break;
case 5:
bulletin();
break;
case 6:
System.out.println("vous étez fermmer le programme ");
System.exit(0);
break;
default:
System.out.println("tapez un autre nombre entre 1 et 6 SVP");
}
} while (r != 6);
}
public static void ajouter() {
System.out.print("conbien des etudiants vous veullez ajouter?");
n = Lire.entierInt();
programmation = new float[n];
instalation = new float[n];
bereautique = new float[n];
français = new float[n];
anglais = new float[n];
arabe = new float[n];
moyenne = new float[n];
nom = new String[n];
prenom = new String[n];
classe = new String[n];
fillier = new String[n];
code = new String[n];
mention = new String[n];
for (i = 0; i < n; i++) {
System.out.println("\tEtudiant N°" + (i + 1));
System.out.println("\t************");
System.out.println("donnez svp le code d'inscription");
code[i] = Lire.chaine();
System.out.println("entrez svp le nom d'etudiant");
nom[i] = Lire.chaine();
System.out.println("entrez svp le prénom d'etudiant");
prenom[i] = Lire.chaine();
System.out.println("entrez svp la Fillier");
fillier[i] = Lire.chaine();
System.out.println("entrez svp la Classe");
classe[i] = Lire.chaine();
System.out.println("entrez svp la note de Programmation");
programmation[i] = Lire.reelFloat();
System.out.println("entrez svp la note d'Instalation");
instalation[i] = Lire.reelFloat();
System.out.println("entrez svp la note de Bereautique");
bereautique[i] = Lire.reelFloat();
System.out.println("entrez svp la note de Français");
français[i] = Lire.reelFloat();
System.out.println("entrez svp la note d'Anglais");
anglais[i] = Lire.reelFloat();
}
}
public static float moyenne() {
for (i = 0; i < n; i++) {
moyenne[i] = (programmation[i] + instalation[i] + bereautique[i] + français[i] + anglais[i] + arabe[i]) / 6;
}
return moyenne[n - 1];
}
public static String mention() {
for (i = 0; i < n; i++) {
if (moyenne[i] >= 16) {
mention[i] = ("trés bien");
} else {
if (moyenne[i] >= 14) {
mention[i] = ("bien");
} else {
if (moyenne[i] >= 12) {
mention[i] = ("assez bien");
} else {
if (moyenne[i] >= 10) {
mention[i] = ("passable");
} else {
mention[i] = ("non admis");
}
}
}
}
}
return mention[n - 1];
}