Correction Partie-II-TP4
Correction Partie-II-TP4
Correction Partie-II-TP4
tabE[countE] = e;
countE++;
System.out.println(tabE[i].calculSalaire());
Classe Employé
public Employé() {}
this.id = id;
this.nom = nom;
}
public Employé(int id, String nom, String adr, int nbh) {
this.id = id;
this.nom = nom;
this.adr = adr;
this.nbh = nbh;
return id;
this.id = id;
return nom;
this.nom = nom;
return adr;
this.adr = adr;
return nbh;
this.nbh = nbh;
}
@Override
+adr+"nbh :"+nbh;
Classe Caissier
//constructeurs
super();
this.numCaisse = numCaisse;
super(id, nom);
this.numCaisse = numCaisse;
public Caissier(int id, String nom, String adr, int nbh, int numCaisse) {
this.numCaisse = numCaisse;
//getter et setter
return numCaisse;
numCaisse = numCaisse;
}
{ return super.nbh*5; }
Classe Responsable
public Responsable() {}
super(id, nom);
this.prime=prime;
super(id,nom,adr,nbh);
this.prime=prime;
return prime; }
this.prime = prime; }
System.out.println("this tostring");
System.out.println(this.toString());
System.out.println("super toString");
System.out.println(super.toString());
}
@Override
return super.nbh*10+prime;
Classe Vendeur
public Vendeur() {}
super(id, nom);
this.taux_deVente = taux_deVente;
return taux_deVente;
this.taux_deVente = taux_deVente;
return 450*this.taux_deVente;
}}
Classe TestEmployé
cais.setNbH(15);
cais.setNumCaisse(12);
cais1.setNom("med");
System.out.println(resp);
m1.ajouterEmploye(cais1);
m1.ajouterEmploye(cais2);
m1.ajouterEmploye(resp);
m1.afficheListeEmploye();
m2.ajouterEmploye(resp);
m2.ajouterEmploye(cais);
m2.ajouterEmploye(cais3);
m2.afficheListeEmploye();
System.out.println(cais3.calculSalaire());
System.out.println(resp.calculSalaire());
m2.afficheSalaireEmploye(); } }