//---------------------------------------------------------------------------- // machine_recapitulatif.txt //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // Ex1.java - recapitulatif //---------------------------------------------------------------------------- class Compte { static int nbMaxComptes; static Compte[] lesComptes; static int nbComptes; static double taux; int numero; int solde; int salaire; Compte(int n, int sol, int sal) { this.numero = n; this.solde = sol; this.salaire = sal; lesComptes[nbComptes] = this; nbComptes++; } static double autorisation(Compte c) { return c.salaire * taux; } static void afficher(Compte c) { System.out.println("cpte: "+c.numero+ ", solde: "+c.solde+ ", sal: "+c.salaire+ ", autor: "+autorisation(c)); } static void saisirTaux(String[] args) { taux = Double.parseDouble(args[0]); } static void afficherTaux() { System.out.println("taux: "+taux); } static void initialiserLesComptes() { nbMaxComptes = 100; nbComptes = 0; lesComptes = new Compte[nbMaxComptes]; } static void afficherLesComptes() { for (int i=0; imax) max = tmp; } return max; } static void afficherAutorisationMax() { System.out.println("autorisation max: "+autorisationMax()); } } //--------------------------------------------------------------------------- class Ex1 { public static void main(String[] args) { Compte.saisirTaux(args); Compte.initialiserLesComptes(); CompteNegocie.initialiserLesComptesNegocies(); Client.initialiserLesClients(); Client.saisirLesClientsEtLesComptes(args); CompteNegocie.remplirLesComptesNegocies(); Compte.afficherTaux(); Compte.afficherLesComptes(); CompteNegocie.afficherLesComptesNegocies(); Client.afficherLesClients(); Client.afficherAutorisationMax(); } } //--------------------------------------------------------------------------- /* java Ex1 0.1 Riton Paname 2 0 1 1000 100 -1 0 2 2000 200 -1 Lulu NewYork 2 1 3 3000 300 30 0 4 4000 400 -1 taux: 0.1 cpte: 1, solde: 1000, sal: 100, autor: 10.0 cpte: 3, solde: 3000, sal: 300, autor: 30.0 cpte neg: 5, solde: 5000, sal: 500, base: 50, autor: 100.0 cpte neg: 6, solde: 6000, sal: 600, base: 60, autor: 120.0 nom: Riton, ville: Paname, cpte: 1, solde: 1000, sal: 100, autor: 10.0 nom: Lulu, ville: NewYork, cpte: 3, solde: 3000, sal: 300, autor: 30.0 autorisation max: 30.0 */ //---------------------------------------------------------------------------