Java Code Solutions For Bank Account Exercise
Java Code Solutions For Bank Account Exercise
public void initialisation(int numCompte, String leNom, String lePrenom, String laVille) {
this.numeroCompte = numCompte;
this.nom = leNom;
this.prenom = lePrenom;
this.ville = laVille;
this.leSolde = 0;
this.leSolde += laSomme;
}
public boolean debiter(int laSomme) {
this.leSolde -= laSomme;
return true;
} else {
return false;
return this.leSolde;
return this.numeroCompte;
ceb1.affiche();
ceb2.affiche();
ceb1.affiche();
ceb2.affiche();
ceb2.crediter(500);
ceb1.affiche();
ceb2.affiche();
ceb2.debiter(400);
if (this.debiter(laSomme)) {
compteDestinataire.crediter(laSomme);
return true;
} else {
return false;
}
public class Main {
System.out.println("Transfert de 100 EUR de Ceb1 vers Ceb2: " + (transfert ? "Réussi" : "Échoué"));
return 1;
return 0;
} else {
return -1;
}
public class Main {
if (comparison == 1) {
} else if (comparison == 0) {
} else {