Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int choix_debut;
- Compte c = null;
- int id_compte;
- do
- {
- System.out.println("Choisissez une opération [1/2/3]");
- System.out.println("1: Choisir un Compte ");
- System.out.println("2: Créer Compte ");
- choix_debut = sc.nextInt();
- if (choix_debut == 1)
- {
- do
- {
- System.out.println("Entrez id compte");
- id_compte = sc.nextInt();
- c = cl.select_compte(id_compte);
- }while(cl == null);
- break;
- }
- else if (choix_debut == 2)
- {
- c = cl.add_compte();
- break;
- }
- }while(choix_debut!=3);
- do // fait -- tant que le choix est different de 4
- {
- System.out.println("Choisissez une opération [1/2/3/4]");
- System.out.println("1: Operations Bancaires ");
- System.out.println("2: Consulter Compte ");
- System.out.println("3: Creer Compte ");
- System.out.println("4: Sortir ");
- choix = sc.nextInt();
- if (choix == 1) // si le choix = 1 alors propose des operations bancaires
- {
- do // fait -- tant que le choix est different de 4
- {
- System.out.println("Choisissez une opération bancaire [1/2/3/4]");
- System.out.println("1: Retrait");
- System.out.println("2: Virement");
- System.out.println("3: Depot");
- System.out.println("4: Retour");
- choix_operation = sc.nextInt(); // l'utilisateur rentre son choix sous forme d int
- switch (choix_operation)
- {
- case 1: c.retrait();
- break;
- case 2: //c.virement();
- break;
- case 3: c.depot(); // appel la fonction depot
- break;
- }
- } while (choix_operation != 4);
- }
- else if (choix == 2)
- System.out.println("Votre solde est de " + c.get_solde() + "euro "); //affiche le solde du compte en faisant appel a la fonction get_solde
- else if (choix==3)
- {
- System.out.println("choisissez un type de compte");
- c = cl.add_compte();
- }
- } while (choix!=4 );
- System.out.println("A bientot ");
- sc.close();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement