From 8a24f7c1ffa2c6c6e15b4aa62ad417587c713fae Mon Sep 17 00:00:00 2001 From: Liam MONCHANIN Date: Thu, 10 Nov 2022 09:26:45 +0100 Subject: [PATCH] depot de tout les fichiers --- Adherents.txt | 6 +++ SAE.c | 143 ++++++++++++++++++++++++++++++++++++++++++++++++++ SAE.h | 17 ++++++ TestSAE.c | 12 +++++ 4 files changed, 178 insertions(+) create mode 100644 Adherents.txt create mode 100755 SAE.c create mode 100644 SAE.h create mode 100644 TestSAE.c diff --git a/Adherents.txt b/Adherents.txt new file mode 100644 index 0000000..c2a42f7 --- /dev/null +++ b/Adherents.txt @@ -0,0 +1,6 @@ +1504 50 +8642 420 +6824 06 +3213 23 +8419 82 +1355 54 diff --git a/SAE.c b/SAE.c new file mode 100755 index 0000000..42e7faf --- /dev/null +++ b/SAE.c @@ -0,0 +1,143 @@ +#include +#include "SAE.h" +#define LEN 100 + +int chargementClients(int *t1, int *t2, int tmax){ //charge les tableaux +FILE *fe; +int numClient, points; +fe=fopen("Adherents.txt","r"); +if(fe==NULL){ + printf("Probleme ouverture fichier"); +return -1;} +int i=0; +fscanf("%d%*c %d%*c",&numClient,&points); +while(feof(fe)==0){ + if(i>tmax){ + printf("taille du tableau dépassée \n"); + fclose(fe); + return-1;} + t1[i]=numClient; + t2[i]=points; + fscanf("%d%*c %d%*c",&numClient,&points); + i++; + } + fclose(fe); + return i; +} + +int rechercheAdherent(int *t1, int *t2,int val,int LENlo,int *trouve){//recherche un adherent et affiche sont identifiant +int i; +for (i=0;i0){ +prix=pts*0.5; +printf("Voulez vous saisir plus de points?(10pts=5€)"); +scanf("%d",&pts);} +printf("Vous avez acheté %d pts pour %.2f €.",pts,prix); +} + + + + + + + + + + + + + + + + + + + + diff --git a/SAE.h b/SAE.h new file mode 100644 index 0000000..c426a39 --- /dev/null +++ b/SAE.h @@ -0,0 +1,17 @@ +/* + \file : SAE.h + \author : Liam Monchanin + Gerer les adhérants d'un complexe sportif ainsi que leurs activités +*/ + +/* + \brief:Gerer les adhérants d'un complexe sportif ainsi que leurs activités +*/ + +int chargementClients(int *t1, int *t2,int tmax); +int rechercheAdherent(int *t1, int *t2,int val,int LENlo,int *trouve); +void choixAdmin(void); +void Admin(void); +void Adherent(void); +int ChoixActivite(int *t1, int *t2); +void DonneesAdherent(int *t1, int *t2); diff --git a/TestSAE.c b/TestSAE.c new file mode 100644 index 0000000..9480aa8 --- /dev/null +++ b/TestSAE.c @@ -0,0 +1,12 @@ +#include "SAE.h" + +void testCode(void){ +int tAdherants[100],tPoints[100]; +chargementClients(tAdherants[100],tPoints[100],100); +choixAdmin; +} + + +int main(void){ + +}