Page 678 - IT2
P. 678

case 2: system("cls");afficher_les_routes();break;
                      case 3: system("cls");rechercher_route();break;
                      case 4: system("cls");supprimer_route();break;
                      case 5: system("cls");sauvegarder();break;
                      case 6:system("cls");quitter();break;
                      default : system("cls");printf("votre choix n'est pas valide !!!\n");
                              }

                              }while(choix!=6);


                        system("PAUSE>null");
                        return 0;
                      }



                     Dossier 2: Programmation orientée objet


                      Développement d’une application orientée objet pour la gestion d’un magasin

               Classe “Article”

               class Article
                   {

                       private string nserie;
                       private float pht;
                       private int qte_stk;
                       private int qte_min;
                       //public Article ();
                       public Article(string nserie, float pht, int qte_stk, int qte_min)
                   {
                       this.nserie = nserie;
                       this.pht = pht;
                       this.qte_stk = qte_stk;
                       this.qte_min = qte_min;


                   }
                public new string ToString()
               {
               return this.nserie +" "+this.pht +" "+ this.qte_stk +" "+ this.qte_min ;
               }
               public void Sapprovisionner (int qte)
               {

               this.qte_stk=this.qte_stk+qte;

               }
               public void Achat(int qte)
               {

                   this.qte_stk = this.qte_stk - qte;
                   if (this.qte_stk < this.qte_min)
                       Console.WriteLine("Attention! il faut s'approvisionner");} }



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