Créationd 'une classe étudiant

Stany -  
 Safi Samia -
J'ai besoin de créer une classe qui permette de gérer les notes d'un étudiant.La création de cett e classe doit se faire en java cependant je n'ai pas de bonnes notions en POO et surtout en java. Ainsi une aide de votre part me fairait du bien.

Stany

3 réponses

  1. choubaka Messages postés 5535 Date d'inscription   Statut Modérateur Dernière intervention   2 113
     
    Salut

    attention, rien n'a été compilé !!!!!

    public class Etudiant {
    
    	private String name;
    	private String surname; 
    	private String age;
    	
    	private Bulletin myCurrentBulletin;
    	private static Vector myBulletins;
    
    	public Etudiant(String name, String surname, String age, String year) {
    
    		this.name = name;
    		this.surname = surname;
    		this.age = age;
    		myCurrentBulletin = new Bulletin(year);
    		this.getMyBulletins.add(myCurrentBulletin);
    	}
    
    	public static Vector getMyBulletins() {
    
    		if ( myBulletins == null ) 
    			myBulletins = new Vector();
    
    		return myBulletins;
    	}
    
    
    	public String getInfo(){
    
    		return "Nom: " + this.name + ", " + "Prénom: " + this.surname + ", " + "Age: " + this.age + "." ;
    
    	}
    
    	public String getName(){
    
    		return this.name;
    
    	}
    
    	public String getSurname(){
    
    		return this.surname;
    
    	}
    
    	public String getAge(){
    		
    		return this.age;
    
    	}
    
    	public Bulletin getCurrentBulletin(){
    		
    		return this.myCurrentBulletin;	
    	}
    
    	public Bulletin getOneBulletin(String year){
    
    		Bulletin tempo;
    
    		Iterator rator = myBulletins.iterator
    
    		for (rator.hasNext()){
    
    			tempo = (Bulletin) rator.next();
    
    			if (tempo.getYear == year){
    
    				return tempo
    			}
    				
    		}	
    
    	}
    
    	public void setName(String name){
    
    		this.name = name;
    	}
    
    	public void setSurname(String surname){
    		
    		this.surname = surname;
    	}
    
    	public void setAge(String age){
    	
    		this.age = age;
    	}
    
    }
    
    
    public class LaClasse {
    
    	private static Vector etudiants;
    	private String name;
    
    	public LaClasse(String name){
    
    		this.name = name;
    
    	}	
    
    	public static Vector getEtudiants() {
    
    		if ( etudiants == null ) 
    			etudiants = new Vector();
    		return etudiants;
    	}
    	public void addNewEtudiant( Etudiant new){
    		this.getEtudiants().add(new);
    	}
    	public Etudiant getOneEtudiant(String name, String surname){
    		// a implémenter !!!
    	}
    
    
    }
    
    public class Bulletin {
    
    	private TreeMap resultats;
    	private String year;
    
    	
    	public Bulletin (String year){
    
    		this.year = year;
    		resultats = new TreeMap();
    		resultats.put( "Math", new Float( 0 ) );
    
    		...................................... // ajouter les matière voulues avec la valeur de départ
    
    	}
    
    	public String getYear(){
    		
    		return this.year;
    	}
    
    	
    	// voilà reste plus qu'a créer les différentes méthodes pour récupérer les points, les moyennes etc, pour jongler avec le TreeMap
    
    	http://java.sun.com/j2se/1.3/docs/api/java/util/TreeMap.html
    
    	
    
    }
    
    // Il reste à créer la classe principale pour faire fonctionner tout le bazar, mais là je te laisse faire
    
    
    1
  2. choubaka Messages postés 5535 Date d'inscription   Statut Modérateur Dernière intervention   2 113
     
    ben vi, j'ai pas tout fait, désolé 8))
    0
  3. Safi Samia
     
    comment faire la méthode supprimerEtudiant() et rechercher Etudiant() et afficherTousEtudiant() svp
    0