-
Notifications
You must be signed in to change notification settings - Fork 0
/
Index.php
41 lines (24 loc) · 1.02 KB
/
Index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<h1>POO Banque</h1>
<p>Vous êtes chargé(e) de créer un projet PHP orienté objet permettant de gérer des titulaires et leurs
comptes bancaires respectifs.</p>
<?php
require "Compte.php";
require "Titulaire.php"; //ne pas oublier le nom de domaine
$titulaire1 = new Titulaire ("Christophe", "Apple", "1982-01-17");
$titulaire2 = new Titulaire ("Jean","Margoulin", "1999-05-25");
$compte1 = new Compte ("livret A", 358.32, "€", $titulaire1);
$compte2 = new Compte ("Compte courant", 2000, "€", $titulaire1);
$compte3 = new Compte ("compte courant", 5056, "francs", $titulaire2);
$titulaire1->afficherComptes();
echo "<br>";
$compte1->virement(100, $compte2); //demande le $montant puis le compte cible $compte2
$titulaire1->afficherComptes();
echo "<br>";
$compte2->debiter(100); //demande la fonction debiter avec le ($montant)
$titulaire1->afficherComptes();
echo "<br>";
$compte2->crediter(500);
$titulaire1->afficherComptes();
echo "<br>";
$titulaire2->afficherComptes();
echo "<br>";