parent
32e2ddaae5
commit
213b0944bf
@ -0,0 +1,122 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include "sae.h"
|
||||||
|
#include <stdlib.h>
|
||||||
|
|
||||||
|
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<x; i++)
|
||||||
|
{
|
||||||
|
fprintf(fe,"\n%d",i);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void creationCompte(int *VSUIVANTE)
|
||||||
|
{
|
||||||
|
char nom[15], prenom[20], categorie, gen, retour;
|
||||||
|
int age, nclient;
|
||||||
|
FILE *fe, *fx, *fn;
|
||||||
|
fe= fopen("donneClient.don", "a");
|
||||||
|
fn= fopen("nclient.don", "r");
|
||||||
|
fx= fopen("x.don","a");
|
||||||
|
|
||||||
|
fprintf(fx,"%d", *VSUIVANTE);
|
||||||
|
|
||||||
|
if (fe==NULL)
|
||||||
|
{
|
||||||
|
printf(" Erreur ouverture fichier");
|
||||||
|
}
|
||||||
|
|
||||||
|
printf("\nEntrez votre nom\n");
|
||||||
|
scanf("%s%*c", nom);
|
||||||
|
|
||||||
|
printf("\nEntrez votre prenom\n");
|
||||||
|
scanf("%s%*c", prenom);
|
||||||
|
|
||||||
|
printf("\nEntrez votre age\n");
|
||||||
|
scanf("%d%*c", &age);
|
||||||
|
|
||||||
|
printf("Avez-vous un tarif spécial: Etudiant(E), Senior(S), aucun(A)?\n");
|
||||||
|
scanf("%c%*c", &categorie);
|
||||||
|
|
||||||
|
|
||||||
|
fprintf(fe,"%d\t",*VSUIVANTE);
|
||||||
|
fprintf(fe,"%s\t",nom);
|
||||||
|
fprintf(fe,"%s\t",prenom);
|
||||||
|
fprintf(fe,"%d\t",age);
|
||||||
|
fprintf(fe,"%c\n",categorie);
|
||||||
|
|
||||||
|
printf("Retour menu?(O/N)\n");
|
||||||
|
scanf("%c%*c", &retour);
|
||||||
|
|
||||||
|
if (retour == 'O')
|
||||||
|
menu();
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -0,0 +1,4 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
void menu (void);
|
||||||
|
void creationCompte(int *VSUIVANTE);
|
||||||
|
void c(void);
|
@ -0,0 +1,9 @@
|
|||||||
|
#include <stdio.h>
|
||||||
|
#include "sae.h"
|
||||||
|
|
||||||
|
int main (void)
|
||||||
|
{
|
||||||
|
c();
|
||||||
|
menu();
|
||||||
|
return 0;
|
||||||
|
}
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in new issue