Example #1
0
        public virtual bool crediter(MAD somme)
        {
            MAD valnul = new MAD(0);

            if (somme > valnul)
            {
                this.solde += somme;

                this.ADD_OP(somme, "+");

                return(true);
            }
            return(false);
        }
Example #2
0
        public CompteEpargne(Client titu, MAD somme, double taux_interet) : base(titu, somme)
        {
            try
            {
                if (taux_interet > 100 || taux_interet < 0)
                {
                    throw e;
                }
            }
            catch (Exception e)
            {
                throw e;
            }

            if (taux_interet > 100 || taux_interet < 0)
            {
                throw new Exception("Valeur du taux est incorrecte");
            }
            else
            {
                this.taux_interet = taux_interet;
            }
        }
Example #3
0
 public CompteCourant(Client titu, MAD somme, MAD dec)  : base(titu, somme)
 {
     this.decouvert = dec;
 }
Example #4
0
        static void Main(string[] args)
        {
            string nom    = Console.ReadLine();
            Client c1     = new Client(nom, "Hamza", "aadd1");
            MAD    solde1 = new MAD(8000);
            MAD    val1   = new MAD(2000);
            Compte cpt    = new Compte(c1, solde1);
            Compte cpt2   = new Compte(c1, solde1);
            Compte cpt3   = new Compte(c1, solde1);

            c1.affectercompt_client(cpt);
            c1.affectercompt_client(cpt2);
            c1.affectercompt_client(cpt3);

/*
 *          cpt2.consulter();
 *          cpt2.afich_op();
 *          cpt2.crediter(val1);
 *          cpt2.debiter(val1);
 *          cpt2.afich_op();
 *          cpt.crediter(val1);
 *          cpt.debiter(val1);
 *          cpt.afich_op();
 *          cpt.crediter(val1);
 *          cpt.debiter(val1);
 *          cpt.afich_op();
 *          //cpt.consulter();
 *          //c1.afich_liste();
 *          // cpt2.consulter();
 *          //cpt3.consulter();
 *          ///////////
 *          /*CompteCourant cpt4 = new CompteCourant(c1,solde1);
 *          Console.WriteLine(cpt4.debiter(val1));
 *          Console.WriteLine(cpt4.debiter(val1));
 *          Console.WriteLine(cpt4.debiter(val1));
 *          Console.WriteLine(cpt4.debiter(val1));
 *          Console.WriteLine(cpt4.debiter(val1));
 *          Console.WriteLine(cpt4.debiter(val1));
 *
 *
 *
 *          c1.affectercompt_client(cpt4);
 *
 *          c1.afich_liste();
 */
            CompteEpergne cptE = new CompteEpergne(c1, new MAD(100), 10);

            //cptE.consulter();
            // cptE.CalcullInteret();
            cptE.consulter();
            CompteCourant CPC = new CompteCourant(c1, solde1);

            CPC.consulter();
            CPC.verser(cptE, new MAD(100));

            Console.WriteLine("CPC=========>cptE");
            cptE.consulter();
            CPC.consulter();



            Console.ReadKey();
        }
Example #5
0
        public static MAD operator -(MAD a, MAD b)
        {
            MAD res = new MAD(a.valeur - b.valeur);

            return(res);
        }
Example #6
0
        public static MAD operator *(MAD a, double b)
        {
            MAD res = new MAD(a.valeur * b);

            return(res);
        }
Example #7
0
 static Compte()
 {
     cpt     = 0;
     plafond = new MAD(3000);
 }
Example #8
0
        public MAD multipledesolde(double b)
        {
            MAD s = this.solde * b;

            return(s);
        }
Example #9
0
        public void ADD_OP(MAD somme, string s)
        {
            operation op = new operation(somme, s, ++this.numop);

            this.historique.Add(op);
        }
Example #10
0
 public bool verifier(MAD m)
 {
     return(this.solde > m);
 }
Example #11
0
 public CompteCourant(Client titu, MAD somme) : base(titu, somme)
 {
 }