Page 679 - IT2
P. 679

Classe « Habit »

               class Habit : Article
                   {
                       private int taille;
                       private string couleur;

                       public Habit (string nserie, float pht, int qte_stk, int
               qte_min,int taille,string couleur)
                       :base( nserie,  pht,  qte_stk,  qte_min)
                       {
                           this.taille = taille;
                           this.couleur = couleur;

                               }


                       public new string ToString()
                       {
                           return base.ToString() + " " + this.taille + " " +
               this.couleur;
                       }
                   }

                      Classe « Electroménager »




               class Electromenager : Article
                   {
                       private float poids;
                       private int duree;

                       public Electromenager(string nserie, float pht, int qte_stk, int
                       qte_min, float poids, int duree)
                           : base(nserie, pht, qte_stk, qte_min)
                       {
                           this.poids = poids;
                           this.duree = duree;

                       }
                       public DateTime datefinGarantie()
                       {
                           DateTime res = DateTime.Now.AddMonths(duree);
                               return (res);
                       }
                       public Boolean Sousgarantie(DateTime date_achat)
                       {
                           DateTime d = DateTime.Now;
                           if (date_achat.AddMonths(duree) > d)
                               return true;
                           else return false;
                       }
                       public new string ToString()
                       {
                           return base.ToString() + " " + this.poids + " " + this.duree;
                       }}

                     Filière                    Epreuve                        Session              8/10
                       DI                 Synthèse V1(Correction)            Juillet 2015
   674   675   676   677   678   679   680   681   682   683   684