public bool verser(compte c, mad somme) { if (solde >= somme) { solde -= somme; c.solde += somme; Console.Out.WriteLine("operation est realisee"); return(true); } else { Console.Out.WriteLine("le solde est insuffisant"); } return(false); }
static void Main(string[] args) { compte c1 = new compte(new client("hamza", "alaoui", "ain chouk"), new mad(4000)); c1.consulter(); c1.crediter(new mad(6000)); c1.consulter(); c1.Debiter(new mad(2000)); c1.consulter(); compte c2 = new compte(new client("tarek", "oufakir", "habous"), new mad(3000)); c2.verser(c1, new mad(2000)); c1.consulter(); c2.consulter(); Console.Read(); }