I'm learning Java programming and have a problem with this code. My issue is I can't stop the second while loop (while (done ==1){ .. })
If I do done = 2, the program resume...
int stopme3 = 1;
while (stopme3 == 1) {
/* Appel de la méthode Afficher les propriétaires */
AfficherProprio();
int choix_proprio = ChoisirProprio();
/* Appel de la méthode Afficher les Comptes du Propriétaire */
AfficherComptesProprietaire(choix_proprio);
/* Choix du compte à modifier */
System.out.println("N° de compte:");
int choixCompte = lectureClavier.nextInt();
/* Test si comptes existants du proprio */
if (choixCompte == tab_compte[choix_proprio]._num_compte) {
int done = 1;
while (done == 1) {
/* Création d'une ligne comptable */
tab_compte[choix_proprio].CreerLigneC();
System.out.println("Ajouter une ligne comptable supplémentaire ?");
System.out.println("1 - Oui");
System.out.println("2 - Non");
done = lectureClavier.nextInt();
}
} else {
System.out.println("Compte sélectionné inexistant.");
}
}
Help is much appreciated, thanks a lot.
done, atdone = lectureClavier.nextInt();lectureClavierappears to mean keyboard.lectureClavier.nextInt()?doneits instopme3which stays int, the outer loop keeps going.