diff --git a/evsae.c b/evsae.c index bd5c78e..7946af4 100644 --- a/evsae.c +++ b/evsae.c @@ -1,122 +1,195 @@ -#include -#include "sae.h" -#include - -void menu (void) - { - char choix, retourmenu; - int VSUIVANTE; - FILE *fx; - - fx=fopen("x.don","r"); - if (fx==NULL) - {printf("erreur"); - return;} - - - while(feof(fx)) - { - fscanf(fx,"%d",&VSUIVANTE); - } - - printf("\nQue souhaitez vous faire?\n"); - printf("\n1- Créer un compte\n"); - printf("2- Presenter sa carte\n"); - printf("\nTapez h pour une aide\n"); - scanf("%c%*c", &choix); - - if (choix == 'h') - { - printf("\n\tBienvenue dans notre application!\n"); - printf("\nVous êtes arrivées dans le menu de notre incroyable salle de sport\n"); - printf("Tapez le nombre au début de la liste des fonctionnalitées pour y accéder"); - printf("\nSi vous êtes nouveau, nous vous conseillons de créer un compte en tapant 1 dan le menu"); - printf("\nTapez O pour retourner au menu principal\n"); - scanf("%c%*c",&retourmenu); - - if (retourmenu == 'O') - - menu(); - } - - if (choix == '1') - { - creationCompte( &VSUIVANTE); - } - - if (choix == '2') - { - printf("gogogogo"); - //Compte() - } - } - -void c(void) - { - int x=10000000, i=0; - FILE *fe; - fe = fopen("nclient.don","w"); - - for (i=0; i +#include "evsae.h" +#include + +void menu (void) + { + char choix, retourmenu; + int VSUIVANTE, next; + FILE *fx; + + fx=fopen("x.don","r"); + + if (fx==NULL) + {printf("erreur"); + return;} + + VSUIVANTE=0; + + while(!feof(fx)) + { + fscanf(fx, "%d", &next); + + if ( next> VSUIVANTE) + { + VSUIVANTE=next; + } + } + + printf("\nQue souhaitez vous faire?\n"); + printf("\n1- Créer un compte\n"); + printf("2- Presenter sa carte\n"); + printf("Controle C pour quitter"); + printf("\nTapez h pour une aide\n"); + + scanf("%*c%c%*c", &choix); + + while ( choix != 'h' && choix != '1' && choix != '2') + { + printf("\nEntrez soit h, soit 1, soit 2.\t"); + scanf("%c", &choix); + } + + if (choix == 'h') + { + printf("\n\tBienvenue dans notre application!\n"); + printf("\nVous êtes arrivées dans le menu de notre incroyable salle de sport\n"); + printf("Tapez le nombre au début de la liste des fonctionnalitées pour y accéder"); + printf("\nSi vous êtes nouveau, nous vous conseillons de créer un compte en tapant 1 dan le menu"); + printf("\nTapez O pour retourner au menu principal\n"); + scanf("%c",&retourmenu); + + while ( retourmenu != 'O') + { + printf("\nTapez la lettre O pour revenir au menu.\t"); + scanf("%*c%c%*c", &retourmenu); + } + + if (retourmenu == 'O') + menu(); + + } + + if (choix == '1') + { + creationCompte( &VSUIVANTE); + } + + if (choix == '2') + { + printf("gogogogo"); + //Compte() + } + + } + + +/* +void c(void) + { + int x=10000000, i=0; + FILE *fe; + fe = fopen("nclient.don","w"); + + for (i=0; i noClient) + + *rang = i; + + return; + + } + +} +void changementEtatCarte ( int *tAd , int *tstate) + { + int nchoix + + printf("\nNouvel état de la carte:"); + + printf("\nDésactiver(0)") + printf("\nActiver(1)") + + scanf("%c%*c",&nchoix + + if (nchoix == 'D') + { + printf("\Mauvais comportement(M)") + + printf("\Carte perdu(P)") + } + + + + + + + + + diff --git a/evsae.h b/evsae.h index dc5d167..554413a 100644 --- a/evsae.h +++ b/evsae.h @@ -1,4 +1,4 @@ #include -void menu (void); +void menu (); void creationCompte(int *VSUIVANTE); -void c(void); +void fRecherche(int *tAd, int n, int noClient, int *coderet, int *rang); diff --git a/evtestsae.c b/evtestsae.c new file mode 100644 index 0000000..958d8af --- /dev/null +++ b/evtestsae.c @@ -0,0 +1,9 @@ +#include +#include "evsae.h" + +int main (void) + { + //c(); + menu(); + return 0; + } diff --git a/test b/test index fb9a757..18e61ce 100755 Binary files a/test and b/test differ diff --git a/x.don b/x.don index 7fdf52a..708a8d5 100644 --- a/x.don +++ b/x.don @@ -1,2 +1,8 @@ -0 --2091757392-2091757392-2085961056 \ No newline at end of file +0 +1 +1 +2 +3 +4 +5 +6 \ No newline at end of file