From 2fc710b292cc96f2107193202491eb6a303d039c Mon Sep 17 00:00:00 2001 From: "ange.bardet" Date: Fri, 10 Nov 2023 09:53:09 +0100 Subject: [PATCH] =?UTF-8?q?ajout=20des=20derni=C3=A8res=20modifications?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- FonctionsClient.c | 35 ++++++++++++++++++++++++----------- FonctionsClient.h | 6 +++--- Globale.c | 14 +++++++------- fichierclient.don | 9 +++++---- 4 files changed, 39 insertions(+), 25 deletions(-) diff --git a/FonctionsClient.c b/FonctionsClient.c index 7668394..bc82157 100644 --- a/FonctionsClient.c +++ b/FonctionsClient.c @@ -10,16 +10,29 @@ *\date 20 oct 2023 */ -float initClient(float *chargeV,int *codeC) +float initClient(float *chargeV,int *codeC, float *cagnotte) { - int tmax=100; + int tmax=100,n,pos; int tabNC [100]={0}, tabsuspension [100]={0}; float tabCAG [100]={0}; - tableaucharge(tabNC,tabCAG,tabsuspension,tmax); -/*vazy je finis demain ça clc*/ + n = tableaucharge(tabNC,tabCAG,tabsuspension,tmax)+1; float volV; printf("Quel est votre code client ? : "); - scanf("%f",codeC); + scanf("%d",codeC); + pos = posRef(tabNC,*codeC,n); + if (pos >= 0) + { + printf("Votre cagnotte actuelle est de %.2f\n",tabCAG[pos]); + *cagnotte = tabCAG[pos]; + } + if (pos >= 0 && tabsuspension[pos] == 1) + { + printf("La carte est suspendu, vous n'avez pas accès a votre cagnotte.\n"); + } + if (pos < 0) + { + printf("Vous n'êtes pas encore référencée dans les clients.\n"); + } printf("Quel est le volume (L) du coffre de votre véhicule : "); scanf("%f",&volV); @@ -74,12 +87,12 @@ int ajoutPanier(int TrefC[],int TquanC[],int nArticle,int Tref[], int n) return nArticle +=1; } -void affichPanier(int TrefC[],int TquanC[],int nArticle,int Tref[], float Tpoid[],float Tvolume[],float Tprix[],float chargeV, float volV,int n) +void affichPanier(int TrefC[],int TquanC[],int nArticle,int Tref[], float Tpoid[],float Tvolume[],float Tprix[],float chargeV, float volV,int n, float cagnotteC) { printf("\nRéf\tQté\tPoids\tVol\tPrixU\tPoidsTot\tVolTot\tPrixTot\tCagnotte\n"); - int i, pos,cagnotte; - float prixtot,volR,chargeR; - int cfinal=0; + int i, pos; + float prixtot,volR,chargeR,cagnotte; + float cfinal=0; float prixfinal=0,volfinal=0,chargefinal=0; for (i=0;i