Exemplo n.º 1
0
 public void verser(Compte C, Mad Montant)
 {
     if (this.debiter(Montant))
     {
         C.crediter(Montant);
     }
 }
Exemplo n.º 2
0
 public Compte(Mad solde, Client Clt)
 {
     Cpt++;
     this.numC      = Cpt;
     this.solde     = solde;
     this.titulaire = Clt;
     //this.plafond = new Mad(1000);
 }
Exemplo n.º 3
0
 public void crediter(Mad S)
 {
     if (S.ispositif())
     {
         this.solde += S;
         Console.WriteLine("Operation reussie");
     }
     else
     {
         Console.WriteLine("Operation échouée donner une valeur positif");
     }
 }
Exemplo n.º 4
0
        static void Main(string[] args)
        {
            Client clt   = new Client("Mhammed", "Tabarani", "26Amr");
            Mad    solde = new Mad(10000);
            Compte Cmpt  = new Compte(solde, clt);

            Cmpt.afficher();
            Client clt2  = new Client("TOTO", "SOSO", "26Amr");
            Compte Cmpt2 = new Compte(solde, clt2);

            Cmpt2.afficher();
            Mad Montant = new Mad(5000);

            Cmpt2.verser(Cmpt, Montant);
            Cmpt.afficher();
            Cmpt2.afficher();
        }
Exemplo n.º 5
0
 public bool debiter(Mad S)
 {
     if (S.ispositif() && S <= this.plafond && this.solde >= S)
     {
         this.solde -= S;
         Console.WriteLine("Operation reussie");
         return(true);
     }
     else if (S > this.plafond)
     {
         Console.WriteLine("operation non autorisé , somme superieur au plafond");
         return(false);
     }
     else if (this.solde < S)
     {
         Console.WriteLine("solde insuffisant");
         return(false);
     }
     else
     {
         Console.WriteLine("Operation échouée donner une valeur positif");
     }
     return(false);
 }
Exemplo n.º 6
0
        public static Mad operator -(Mad V1, Mad V2)
        {
            Mad Sous = new Mad(V1.valeur - V2.valeur);

            return(Sous);
        }
Exemplo n.º 7
0
        public static Mad operator +(Mad V1, Mad V2)
        {
            Mad Somme = new Mad(V1.valeur + V2.valeur);

            return(Somme);
        }