|
|
|
@ -5,7 +5,7 @@
|
|
|
|
|
void main(void)
|
|
|
|
|
{
|
|
|
|
|
char nom[15], prenom[15], fnom[15], fprenom[15], bCard, member, categ, recharge, acti1[15], acti2[15], acti3[15];
|
|
|
|
|
int erreur, numAd, age, state, acti, passeoupas, ptsbought,ptsbonus, numCard, avoiravecevann, testnom, testpnom, found = 0, ptrecharge, nbacti;
|
|
|
|
|
int erreur, numAd, age, state, acti, passeoupas, ptsbought,ptsbonus, numCard, avoiravecevann, testnom, testpnom, found = 0, ptrecharge, nbacti, numacti;
|
|
|
|
|
|
|
|
|
|
FILE *f;
|
|
|
|
|
f = fopen("donneeClient.don","r");
|
|
|
|
@ -132,14 +132,137 @@ void main(void)
|
|
|
|
|
{
|
|
|
|
|
printf("Quelle est-elle ?(zumba/badminton/musculation/football/squash)\n");
|
|
|
|
|
scanf("%s", acti1);
|
|
|
|
|
while(strcmp(acti1, "zumba") != 0 && strcmp(acti1, "badminton") != 0 && strcmp(acti1, "musculation") != 0 && strcmp(acti1, "squash") != 0 && strcmp(acti1, "football") != 0)
|
|
|
|
|
z = strcmp(acti1, "zumba");
|
|
|
|
|
b = strcmp(acti1, "badminton");
|
|
|
|
|
m = strcmp(acti1, "musculation");
|
|
|
|
|
s = strcmp(acti1, "squash");
|
|
|
|
|
f = strcmp(acti1, "football");
|
|
|
|
|
while(z != 0 && b != 0 && m != 0 && s != 0 && f != 0)
|
|
|
|
|
{
|
|
|
|
|
printf("Veuillez saisir une activité correcte \n");
|
|
|
|
|
scanf("%s", acti1);
|
|
|
|
|
}
|
|
|
|
|
if (z == 0)
|
|
|
|
|
{
|
|
|
|
|
numacti = 5;
|
|
|
|
|
if (ptsbought < 5)
|
|
|
|
|
{
|
|
|
|
|
printf("Pas assez de points disponibles sur la carte, rechargement souhaité ? (O/N)\n");
|
|
|
|
|
scanf("%c%*c", &recharge);
|
|
|
|
|
if (recharge == 'N')
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//RELOAD AND CONTINUE
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
ptsbought -= 5;
|
|
|
|
|
ptsbonus += 5;
|
|
|
|
|
if (ptsbonus >= 100)
|
|
|
|
|
{
|
|
|
|
|
ptsbought += 15;
|
|
|
|
|
ptsbonus -= 100;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (b == 0)
|
|
|
|
|
{
|
|
|
|
|
numacti = 1;
|
|
|
|
|
if (ptsbought < 8)
|
|
|
|
|
printf("Pas assez de points disponibles sur la carte, rechargement souhaité ? (O/N)\n");
|
|
|
|
|
scanf("%c%*c", &recharge);
|
|
|
|
|
if (recharge == 'N')
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//RELOAD AND CONTINUE
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
ptsbought -= 8;
|
|
|
|
|
ptsbonus += 8;
|
|
|
|
|
if (ptsbonus >= 100)
|
|
|
|
|
{
|
|
|
|
|
ptsbought += 15;
|
|
|
|
|
ptsbonus -= 100;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (s == 0)
|
|
|
|
|
{
|
|
|
|
|
numacti = 4;
|
|
|
|
|
if (ptsbought < 10)
|
|
|
|
|
printf("Pas assez de points disponibles sur la carte, rechargement souhaité ? (O/N)\n");
|
|
|
|
|
scanf("%c%*c", &recharge);
|
|
|
|
|
if (recharge == 'N')
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//RELOAD AND CONTINUE
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
ptsbought -= 10;
|
|
|
|
|
ptsbonus += 10;
|
|
|
|
|
if (ptsbonus >= 100)
|
|
|
|
|
{
|
|
|
|
|
ptsbought += 15;
|
|
|
|
|
ptsbonus -= 100;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (f == 0)
|
|
|
|
|
{
|
|
|
|
|
numacti = 3;
|
|
|
|
|
if (ptsbought < 5)
|
|
|
|
|
printf("Pas assez de points disponibles sur la carte, rechargement souhaité ? (O/N)\n");
|
|
|
|
|
scanf("%c%*c", &recharge);
|
|
|
|
|
if (recharge == 'N')
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//RELOAD AND CONTINUE
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
ptsbought -= 5;
|
|
|
|
|
ptsbonus += 5;
|
|
|
|
|
if (ptsbonus >= 100)
|
|
|
|
|
{
|
|
|
|
|
ptsbought += 15;
|
|
|
|
|
ptsbonus -= 100;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (m == 0)
|
|
|
|
|
{
|
|
|
|
|
numacti = 2;
|
|
|
|
|
if (ptsbought < 15)
|
|
|
|
|
printf("Pas assez de points disponibles sur la carte, rechargement souhaité ? (O/N)\n");
|
|
|
|
|
scanf("%c%*c", &recharge);
|
|
|
|
|
if (recharge == 'N')
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
//RELOAD AND CONTINUE
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
ptsbought -= 15;
|
|
|
|
|
ptsbonus += 15;
|
|
|
|
|
if (ptsbonus >= 100)
|
|
|
|
|
{
|
|
|
|
|
ptsbought += 15;
|
|
|
|
|
ptsbonus -= 100;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|