MàJ par récupération sur Clé USB et dans /mnt/hd/Chargement du pc portable
Cette révision appartient à :
		
							
								
								
									
										
											BIN
										
									
								
								G5a/Solutions/3-exosClasses-1/2-AdherentGerant/DCA_adherent_gerant.jpg
									
									
									
									
									
										Fichier normal
									
								
							
							
						
						
									
										
											BIN
										
									
								
								G5a/Solutions/3-exosClasses-1/2-AdherentGerant/DCA_adherent_gerant.jpg
									
									
									
									
									
										Fichier normal
									
								
							
										
											Fichier binaire non affiché.
										
									
								
							| 
		 Après Largeur: | Hauteur: | Taille: 41 KiB  | 
							
								
								
									
										263
									
								
								G5a/Solutions/3-exosClasses-1/2-AdherentGerant/Pack_adherents/Adherent.java
									
									
									
									
									
										Fichier normal
									
								
							
							
						
						
									
										263
									
								
								G5a/Solutions/3-exosClasses-1/2-AdherentGerant/Pack_adherents/Adherent.java
									
									
									
									
									
										Fichier normal
									
								
							@@ -0,0 +1,263 @@
 | 
			
		||||
 | 
			
		||||
/** Java class "Adherent.java" generated from Poseidon for UML.
 | 
			
		||||
 *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
 | 
			
		||||
 *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
 | 
			
		||||
 */
 | 
			
		||||
package Pack_adherents;
 | 
			
		||||
 | 
			
		||||
import java.util.*;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * 
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
public class Adherent {
 | 
			
		||||
 | 
			
		||||
  ///////////////////////////////////////
 | 
			
		||||
  // attributes
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Represents ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    private int numeroAdherent; 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Represents ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    private String nom; 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Represents ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    private String ville; 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Represents ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    private int anneeNaissance; 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Represente le montant de la cotisation (commun à tous les adherents)
 | 
			
		||||
 * </p>
 | 
			
		||||
 * 
 | 
			
		||||
 */
 | 
			
		||||
    private static int c_montantCotisation=45; 
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Represente le montant actuellement verse par l'adherent
 | 
			
		||||
 * </p>
 | 
			
		||||
 * 
 | 
			
		||||
 */
 | 
			
		||||
    private int cotisationVersee; 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  ///////////////////////////////////////
 | 
			
		||||
  // operations
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Does ...
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @return a String with ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public String getNom() {        
 | 
			
		||||
        // your code here
 | 
			
		||||
        return this.nom;
 | 
			
		||||
    } // end getNom        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Represents ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public int getNumeroAdh() {        
 | 
			
		||||
        return this.numeroAdherent;
 | 
			
		||||
    } // end getNumeroAdh        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Does ...
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @return a int with ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public int getAge() {        
 | 
			
		||||
        // your code here       
 | 
			
		||||
        return 2005-anneeNaissance;
 | 
			
		||||
    } // end getAge        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Represents ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public int getCotisationVersee() {        
 | 
			
		||||
        return cotisationVersee;
 | 
			
		||||
    } // end getCotisationVersee        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @return a boolean : l'adherent est ou non à jour de cotisation
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public boolean aJour() {        
 | 
			
		||||
         // your code here
 | 
			
		||||
          if (cotisationVersee>=c_montantCotisation) 
 | 
			
		||||
             return true; 
 | 
			
		||||
          else 
 | 
			
		||||
             return false;   
 | 
			
		||||
        
 | 
			
		||||
    } // end aJour        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Ajoute la somme passee en param au montant de la cotisation versee
 | 
			
		||||
 * </p>
 | 
			
		||||
 * <p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @return a boolean qui dit si l'adherent est a jour apres ce versement
 | 
			
		||||
 * </p>
 | 
			
		||||
 * <p>
 | 
			
		||||
 * @param versement montant de la somme versee
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public boolean cotiser(int versement) {        
 | 
			
		||||
        // your code here
 | 
			
		||||
         cotisationVersee+=versement;
 | 
			
		||||
         return aJour();
 | 
			
		||||
    } // end cotiser        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @return a String : "A jour" ou " PAS A JOUR !!!"
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public String etat() {        
 | 
			
		||||
        // your code here
 | 
			
		||||
        String etat;
 | 
			
		||||
        if (this.aJour()) etat = "a jour"; else etat = "PAS A JOUR !!!";
 | 
			
		||||
        return etat;
 | 
			
		||||
    } // end etat        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Does ...
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @return a String with ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public String toString() {        
 | 
			
		||||
        // your code here
 | 
			
		||||
        return (getNumeroAdh()+" "+getNom()+" "+getVille()+" "+getAge()+" ans : a cotise : "+getCotisationVersee()+" "+etat());
 | 
			
		||||
    } // end toString        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Does ...
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @param args ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public static void main(String[] args) {        
 | 
			
		||||
        // your code here
 | 
			
		||||
         Adherent a1=new Adherent(1,"Dupont","Paris",1980);
 | 
			
		||||
         Adherent a2=new Adherent(2,"Meyer","Strasbourg",1955);
 | 
			
		||||
         Adherent a3=new Adherent(3,"Legwenn","Brest",1960);
 | 
			
		||||
         System.out.println (a1);
 | 
			
		||||
         System.out.println (a2);
 | 
			
		||||
         System.out.println (a3);
 | 
			
		||||
         System.out.println ();
 | 
			
		||||
         a1.cotiser(45);
 | 
			
		||||
         System.out.println (a1);
 | 
			
		||||
         System.out.println (a2);
 | 
			
		||||
         System.out.println (a3);
 | 
			
		||||
         System.out.println ();
 | 
			
		||||
         a2.cotiser(30);
 | 
			
		||||
         System.out.println (a1);
 | 
			
		||||
         System.out.println (a2);
 | 
			
		||||
         System.out.println (a3);
 | 
			
		||||
         System.out.println ();
 | 
			
		||||
         a3.cotiser(40);
 | 
			
		||||
         System.out.println (a1);
 | 
			
		||||
         System.out.println (a2);
 | 
			
		||||
         System.out.println (a3);
 | 
			
		||||
         System.out.println ();
 | 
			
		||||
         a2.cotiser(15);
 | 
			
		||||
         System.out.println (a1);
 | 
			
		||||
         System.out.println (a2);
 | 
			
		||||
         System.out.println (a3);
 | 
			
		||||
    } // end main        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Constructeur d'Adherent
 | 
			
		||||
 * </p>
 | 
			
		||||
 * <p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @return a Adherent
 | 
			
		||||
 * </p>
 | 
			
		||||
 * <p>
 | 
			
		||||
 * @param num ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 * <p>
 | 
			
		||||
 * @param nom ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 * <p>
 | 
			
		||||
 * @param vil ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 * <p>
 | 
			
		||||
 * @param nss ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public  Adherent(int num, String nom, String vil, int nss) {        
 | 
			
		||||
        // your code here
 | 
			
		||||
        this.numeroAdherent=num;
 | 
			
		||||
        this.nom=nom;
 | 
			
		||||
        this.ville=vil;
 | 
			
		||||
        this.anneeNaissance=nss;
 | 
			
		||||
    } // end Adherent        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Represents ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public String getVille() {        
 | 
			
		||||
        return ville;
 | 
			
		||||
    } // end getVille        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Represents ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public void setVille(String _ville) {        
 | 
			
		||||
        ville = _ville;
 | 
			
		||||
    } // end setVille        
 | 
			
		||||
 | 
			
		||||
} // end Adherent
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										134
									
								
								G5a/Solutions/3-exosClasses-1/2-AdherentGerant/Pack_adherents/Gerant.java
									
									
									
									
									
										Fichier normal
									
								
							
							
						
						
									
										134
									
								
								G5a/Solutions/3-exosClasses-1/2-AdherentGerant/Pack_adherents/Gerant.java
									
									
									
									
									
										Fichier normal
									
								
							@@ -0,0 +1,134 @@
 | 
			
		||||
 | 
			
		||||
/** Java class "Gerant.java" generated from Poseidon for UML.
 | 
			
		||||
 *  Poseidon for UML is developed by <A HREF="http://www.gentleware.com">Gentleware</A>.
 | 
			
		||||
 *  Generated with <A HREF="http://jakarta.apache.org/velocity/">velocity</A> template engine.
 | 
			
		||||
 */
 | 
			
		||||
package Pack_adherents;
 | 
			
		||||
 | 
			
		||||
import java.util.*;
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * 
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
class Gerant {
 | 
			
		||||
 | 
			
		||||
  ///////////////////////////////////////
 | 
			
		||||
  // attributes
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * 
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public static Collection adherent = new Vector(); 
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
  ///////////////////////////////////////
 | 
			
		||||
  // operations
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Does ...
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * 
 | 
			
		||||
 * 
 | 
			
		||||
 * @param args ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public static void main(String[] args) {        
 | 
			
		||||
        
 | 
			
		||||
          
 | 
			
		||||
        
 | 
			
		||||
        
 | 
			
		||||
           Adherent a1=new Adherent(1,"Dupont","Paris",1980);
 | 
			
		||||
           addAdherent(a1);
 | 
			
		||||
           Adherent a2=new Adherent(2,"Meyer","Strasbourg",1955);
 | 
			
		||||
           addAdherent(a2);
 | 
			
		||||
           Adherent a3=new Adherent(3,"Legwenn","Brest",1960);
 | 
			
		||||
           addAdherent(a3);
 | 
			
		||||
           for (int i=0;i<adherent.size();i++){
 | 
			
		||||
              Vector v=(Vector)getAdherents();
 | 
			
		||||
              Adherent a=(Adherent)v.elementAt(i);
 | 
			
		||||
              System.out.println (a);
 | 
			
		||||
              }
 | 
			
		||||
           System.out.println ();
 | 
			
		||||
           a1.cotiser(45);
 | 
			
		||||
           for (int i=0;i<adherent.size();i++){
 | 
			
		||||
              Vector v=(Vector)getAdherents();
 | 
			
		||||
              Adherent a=(Adherent)v.elementAt(i);
 | 
			
		||||
              System.out.println (a);
 | 
			
		||||
              }
 | 
			
		||||
           System.out.println ();
 | 
			
		||||
           a2.cotiser(30);
 | 
			
		||||
           for (int i=0;i<adherent.size();i++){
 | 
			
		||||
              Vector v=(Vector)getAdherents();
 | 
			
		||||
              Adherent a=(Adherent)v.elementAt(i);
 | 
			
		||||
              System.out.println (a);
 | 
			
		||||
              }
 | 
			
		||||
           System.out.println ();
 | 
			
		||||
           a3.cotiser(40);
 | 
			
		||||
           for (int i=0;i<adherent.size();i++){
 | 
			
		||||
              Vector v=(Vector)getAdherents();
 | 
			
		||||
              Adherent a=(Adherent)v.elementAt(i);
 | 
			
		||||
              System.out.println (a);
 | 
			
		||||
              }
 | 
			
		||||
           System.out.println ();
 | 
			
		||||
           a2.cotiser(15);
 | 
			
		||||
           for (int i=0;i<adherent.size();i++){
 | 
			
		||||
              Vector v=(Vector)getAdherents();
 | 
			
		||||
              Adherent a=(Adherent)v.elementAt(i);
 | 
			
		||||
              System.out.println (a);
 | 
			
		||||
              }
 | 
			
		||||
    } // end main        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Does ...
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @return a Collection with ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public static Collection getAdherents() {        
 | 
			
		||||
        return adherent;
 | 
			
		||||
    } // end getAdherents        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Does ...
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @param adherent ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public static void addAdherent(Adherent adherent) {        
 | 
			
		||||
        if (! Gerant.adherent.contains(adherent)) Gerant.adherent.add(adherent);
 | 
			
		||||
    } // end addAdherent        
 | 
			
		||||
 | 
			
		||||
/**
 | 
			
		||||
 * <p>
 | 
			
		||||
 * Does ...
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * </p><p>
 | 
			
		||||
 * 
 | 
			
		||||
 * @param adherent ...
 | 
			
		||||
 * </p>
 | 
			
		||||
 */
 | 
			
		||||
    public static void removeAdherent(Adherent adherent) {        
 | 
			
		||||
        Gerant.adherent.remove(adherent);
 | 
			
		||||
    } // end removeAdherent        
 | 
			
		||||
 | 
			
		||||
} // end Gerant
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
		Référencer dans un nouveau ticket
	
	Bloquer un utilisateur