Vous êtes sur la page 1sur 4

import java .util .

Scanner

class Employé {

private int matricule ;

private String nom ;

private float salaire ;

private Service service ;

public Employe (int matricule ,String nom, float salaire,Service service ){

this.matricule=matricule ;

this.nom=nom;

this.salaire=salaire;

this.service=service ;

public void Employe (nom, salaire) {

nom=nom employe;

salaire=salaire employe;

public int getMat() {

return matricule ;

public String getNom() {

return nom;

public void setService() {

return service ;
}

public float augmenterSalaire () {

return salaire ;

public void afficher() {

System.out.println ("(" +matricule+ "," +nom+ ", " +salaire+ ")") ;

class Service {

private String nom;

private Employe chef ;

private ArrayList<Employe> tabEmp ;

public Service (String nom, Employe chef, ArrayList<Employe> tabEmp){

this.nom=nom;

this.chef=chef;

this.tabEmp=tabEmp;

public String Service(nom) {

return this.nom=nom ;

public String getNom() {

return nom ;

public Employe getChef() {


return chef;

public void setChef(Employe chef)

this.chef=chef

public void affecterEmp()

Employe=Emp ;

public void eliminerEmp(String nom,float salaire){

employe.eliminer(nom,salaire) ;

public String augmeneterSalaire(){

return salaire ;

public void afficher (){

System.out.print ("nom du service : ")

class Test {

public static void main (String [] args) {

Scanner keyb= new Scanner(System.in) ;

Employe E1 , E2,E3,E4 ;

system.out.println ("Taper nom et salaire de l'employe 1 :") ;

E1=new Employ ( keyb.nextLine () , keyb.nextLine () ) ;

system.out.println ("Taper nom et salaire de l'employe 2 :") ;

E2=new Employ ( keyb.nextLine () , keyb.nextLine () ) ;


system.out.println ("Taper nom et salaire de l'employe 3 :") ;

E3=new Employ ( keyb.nextLine () , keyb.nextLine () ) ;

system.out.println ("Taper nom et salaire de l'employe 4 :") ;

E4=new Employ ( keyb.nextLine () , keyb.nextLine () ) ;

Service S1 ,S2;

system.out.println ("Taper nom de Service 1 :") ;

S1=new Service ( keyb.nextLine () , keyb.nextLine () ) ;

system.out.println ("Taper nom de Service 2 :") ;

S2=new Service ( keyb.nextLine () , keyb.nextLine () ) ;

Vous aimerez peut-être aussi