Page 483 - IT2
P. 483

Dossier 2: Programmation orientée objet


                          Développement d’une application orientée objet pour la société informatique

                            Classe "Zone"


                             using System;

                             namespace Société_informatique
                             {
                                 public class Zone
                                 {
                                     private uint IdZone;
                                     private string NomZone;

                                     private static uint auto;

                                     public Zone(string NomZone)
                                     {
                                         this.NomZone = NomZone;
                                         auto++;
                                         IdZone = auto;
                                     }

                                     public uint pIdZone
                                     {
                                         get { return IdZone; }
                                     }

                                     public string pNomZone
                                     {
                                         get { return NomZone; }
                                         set { NomZone = value; }
                                     }

                                     public new string ToString()
                                     {
                                         return NomZone + ".";
                                     }
                                 }
                             }

                            Classe "Pays"


                             using System;
                             using System.Collections.Generic;

                             namespace Société_informatique
                             {
                                 public class Pays
                                 {
                                     private uint IdPays;
                                     private string NomPays;
                                     private Zone zone;

                     Filière                    Epreuve                        Session              6/13
                      TDI                 Synthèse V1(Correction)            Juillet 2014
   478   479   480   481   482   483   484   485   486   487   488