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
| import java.util.Scanner;
public class Etudiant {
Scanner src = new Scanner(System.in);
public String Nom,Num;
class Matiere{
String Matieres[] = new String[3];
double Notes[] = new double [3],Controles[] = new double [2];
int Coef[] = new int [2];int i =0;
public Matiere(){
System.out.println("Donnez le nom de la matiére : ");
Matieres[i] = src.nextLine();
System.out.println("Résultat du premiér controle : ");
Controles[0] = src.nextDouble();
System.out.println("son coefficient : ");
Coef[0] = src.nextInt();
System.out.println("Résultat du deuxiéme controle : ");
Controles[1] = src.nextDouble();
System.out.println("son coefficient : ");//ضاربه
Coef[1] = src.nextInt();
Notes[i] = ( (Controles[0]*Coef[0]) + (Controles[1]*Coef[0]) )/2;
System.out.println("Moyenne de cette mayiére : "+Notes[i]);
}
}
public Etudiant(){
System.out.println("Quel est votre nom ? ");
Nom = src.nextLine();
System.out.println("Votre num ? ");
Num = src.nextLine();
}
public static void main(String args[]){
Etudiant Etu_1 = new Etudiant();
Matiere Matr_1 = Etu_1.new Matiere();
}
} |
Partager