// IFT1020 - 7 mai 2003 // auteur : Laurent Nepveu (nepveul) public class Exo3 { static double notes[] = {90, 85, 81, 77, 73, 69, 66, 62, 59, 56, 53, 50, 30, 0}; static String lettres[] = {"A+","A", "A-","B+","B","B-","C+","C","C-","D+","D","D-","E","F"}; static String mentions[] = {"Excellent","Excellent","Excellent", "Très bon","Très bon","Très bon", "Bon","Bon","Bon", "Passable","Passable","Passable", "Echec","Echec lamentable"}; public static void main(String[] args) { if (args.length != 6) System.out.println("usage : java Exo3 intra final tp1 tp2 tp3 tp4"); else { double intra = Double.parseDouble(args[0]); double fin = Double.parseDouble(args[1]); double tp1 = Double.parseDouble(args[2]); double tp2 = Double.parseDouble(args[3]); double tp3 = Double.parseDouble(args[4]); double tp4 = Double.parseDouble(args[5]); double note_finale; if ((0.2*intra+0.4*fin) >= 30) note_finale = 0.2*intra + 0.4*fin + 0.1*tp1 + 0.1*tp2 + 0.1*tp3 + 0.1*tp4; else note_finale = 0.2*intra + 0.4*fin + (0.1*tp1 + 0.1*tp2 + 0.1*tp3 + 0.1*tp4)/2; int i=0; for (i=0;i= notes[i]) break; } System.out.println("Note finale = " + note_finale); System.out.println("Lettre = " + lettres[i]); System.out.println("Mention = " + mentions[i]); } } }