From 4176158f3bdcdda18241f2958fe9243e8b894f0f Mon Sep 17 00:00:00 2001 From: cyriaklinux Date: Wed, 8 Nov 2023 23:28:00 +0100 Subject: [PATCH] fix bug et test fonction niquel --- FonctionsResponsable.c | 25 +++++++++---------------- articles.don | 1 - fichierclient.don | 5 ++++- 3 files changed, 13 insertions(+), 18 deletions(-) diff --git a/FonctionsResponsable.c b/FonctionsResponsable.c index 6d30cca..faf46d9 100644 --- a/FonctionsResponsable.c +++ b/FonctionsResponsable.c @@ -273,7 +273,6 @@ void modifclientglobal (void) } } coderreur=enregistrement(tabNC,tabCAG,tabsuspension,&n); - printf("Au revoir !\n"); return; } @@ -332,7 +331,7 @@ int ajoutClient (int tabNC[],float tabCAG[],int tabsuspension[],int *tlogique,in } while (numeroclient<0) { - printf("le numéro du client ne peut être négatif , réessayez\n'999' pour quitter."); + printf("le numéro du client ne peut être négatif , réessayez\n'999' pour quitter.\n"); scanf("%d",&numeroclient); if (numeroclient==999) { @@ -438,18 +437,17 @@ int suspensioncarte (int tabNC[],float tabCAG[],int tabsuspension[],int *tlogiqu scanf("%d",&nouvellecarte); } for (compteur=0;compteur<=*tlogique;compteur++) - { - while (nouvellecarte==tabNC[compteur]) + + while (tabNC[compteur]==nouvellecarte) { printf("le client existe déja, ressaisissez\n"); scanf("%d",&nouvellecarte); - while(nouvellecarte<0){ + while(nouvellecarte<0) { printf("le numéro ne peut étre négatif , rééssayez.\n"); scanf("%d",&nouvellecarte); } } - } tabNC[*tlogique]=nouvellecarte; tabCAG[*tlogique]=tabCAG[compteurCAG]; @@ -458,14 +456,8 @@ int suspensioncarte (int tabNC[],float tabCAG[],int tabsuspension[],int *tlogiqu printf("état de suspension modifié et nouvelle carte crée !\n"); return 0; } - - if (tabsuspension[compteurCAG]==0) - { - printf("état de suspension modifié !\n"); - return 0; - } - - } + printf("état de suspension modifié !\n"); + return 0; } int supressionclient (int tabNC[],float tabCAG[],int tabsuspension[],int *tlogique,int tmax) @@ -482,7 +474,7 @@ int supressionclient (int tabNC[],float tabCAG[],int tabsuspension[],int *tlogiq } while(recherche<0) { - printf("ne peut étre négatif\n'999' pour quitter."); + printf("ne peut étre négatif\n'999' pour quitter.\n"); scanf("%d",&recherche); if (recherche==999) { @@ -541,7 +533,7 @@ int affichagesolo (int tabNC[],float tabCAG[],int tabsuspension[],int *tlogique) } while(rechercher<0) { - printf("ne peut étre négatif\n'999' pour quitter."); + printf("ne peut étre négatif\n'999' pour quitter.\n"); scanf("%d",&rechercher); if (rechercher==999) { @@ -559,6 +551,7 @@ int affichagesolo (int tabNC[],float tabCAG[],int tabsuspension[],int *tlogique) printf("%d\t%.2f\t%d\n",tabNC[compteur],tabCAG[compteur],tabsuspension[compteur]); return 0; } + compteur=compteur+1; } printf("ce client n'existe pas\n"); return 0; diff --git a/articles.don b/articles.don index 36d134e..f4640b1 100644 --- a/articles.don +++ b/articles.don @@ -3,4 +3,3 @@ 272 6.50 10.000 29.99 66 33.00 11.000 22.00 345 30.00 29.000 10.00 -564 38.000 20.00 17.90 \ No newline at end of file diff --git a/fichierclient.don b/fichierclient.don index 8b02b2b..602b886 100644 --- a/fichierclient.don +++ b/fichierclient.don @@ -1,2 +1,5 @@ 344 0.00 0 -89 0.00 1 +12 0.00 0 +42 0.00 0 +414 0.00 0 +142 0.00 1