Blame view

tp2_banques/tp2/comptes/TestComptes.java 1008 Bytes
fed1c83c   Vincent Benoist   tp2 et 3
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
  
  
  public class TestComptes{
      
      public static void main(String[] args){
      
          Compte unCompte = new Compte();
          CompteEpargne unCE = new CompteEpargne();
          System.out.println(unCompte.toString());
          System.out.println(unCE.toString());
          
          unCompte.crediter(100.0);
          unCE.crediter(200.0);
          
          System.out.println(unCompte.toString());
          System.out.println(unCE.toString());
          //unCompte.etat();
          System.out.println(unCE.etat());
         
          //unCE=unCompte; -> incompatibletype
      
          
          Banque b = new Banque();
          b.crediter(unCompte, 10);
          b.debiter(unCompte, 235);
          System.out.println(b.etat(unCompte));
          
          b.crediter(unCE, 10);
          b.debiter(unCE, 235);
          System.out.println(b.etat(unCE));
          
          unCompte=unCE;
          
          b.crediter(unCompte, 10);
          b.debiter(unCompte, 235);
          System.out.println(b.etat(unCompte));
      }
      
      
  }