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
|
while (rep=="oui")
{
NomC=JOptionPane.showInputDialog("....");
PrixHorsTaxe=idem;
Quantite=idem;
//convertion des données
int Px = Integer.parseInt(PrixHorsTaxe);
int Quant = Integer.parseInt(Quantite);
//compteur initialiser a zero en dehors de la boucle
cpt=cpt+1;
//conversion du compteur dans une variable
String Numcpt = Integer.toString(cpt);
//début des problèmes
//le nom de l'objet devrais avoir numerocpt1,numerocpt2,numerocpt3,etc..
c = numerocpt+Numcpt;
//création de l'objet
Compte c;
//initiation de l'objet
c = new Compte(cpt,NomC,Px,Quant);
rep=JOptionPane.showInputDialog("Voulez vous saisir un compte ?");
} |
Partager