|
|
@ -8,7 +8,7 @@ void AjoutPoints(int tNoCarte[], int tPointsCarte[], int tCarteActive[], int nbe
|
|
|
|
pas = rechercheAdherent(tNoCarte, nbelem, NoCarte, &trouve);
|
|
|
|
pas = rechercheAdherent(tNoCarte, nbelem, NoCarte, &trouve);
|
|
|
|
if (trouve == 1)
|
|
|
|
if (trouve == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("Entrez le nombre de points a ajouter: ");
|
|
|
|
printf("Entrez le nombre de points à ajouter : ");
|
|
|
|
scanf("%d", &pointsCarte);
|
|
|
|
scanf("%d", &pointsCarte);
|
|
|
|
if (pointsCarte > 0 && pointsCarte <= 20)
|
|
|
|
if (pointsCarte > 0 && pointsCarte <= 20)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -16,37 +16,34 @@ void AjoutPoints(int tNoCarte[], int tPointsCarte[], int tCarteActive[], int nbe
|
|
|
|
tCarteActive[pas] = 1;
|
|
|
|
tCarteActive[pas] = 1;
|
|
|
|
printf("La carte est active.\n");
|
|
|
|
printf("La carte est active.\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else if (pointsCarte > 20 && pointsCarte <= 50)
|
|
|
|
if(pointsCarte > 20 && pointsCarte <= 50)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tPointsCarte[pas] = pointsCarte + pointsCarte * (1 + (5 / 100.0));
|
|
|
|
tPointsCarte[pas] = pointsCarte + pointsCarte * (1 + (5 / 100.0));
|
|
|
|
tCarteActive[pas] = 1;
|
|
|
|
tCarteActive[pas] = 1;
|
|
|
|
printf("Merci pour votre achat. Nous vous offrons 5%% supplémentaires. De plus, votre carte est active.\n");
|
|
|
|
printf("Merci pour votre achat. Nous vous offrons 5%% supplémentaires.\nDe plus, votre carte est active.\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else if (pointsCarte > 50 && pointsCarte <= 100)
|
|
|
|
if(pointsCarte > 50 && pointsCarte <= 100)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tPointsCarte[pas] = pointsCarte + pointsCarte * (1 + (10 / 100.0));
|
|
|
|
tPointsCarte[pas] = pointsCarte + pointsCarte * (1 + (10 / 100.0));
|
|
|
|
tCarteActive[pas] = 1;
|
|
|
|
tCarteActive[pas] = 1;
|
|
|
|
printf("Merci pour votre achat. Nous vous offrons 10%% supplémentaires. De plus, votre carte est active.\n");
|
|
|
|
printf("Merci pour votre achat. Nous vous offrons 10%% supplémentaires.\nDe plus, votre carte est active.\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else if (pointsCarte > 100)
|
|
|
|
if(pointsCarte > 100)
|
|
|
|
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tPointsCarte[pas] = pointsCarte + pointsCarte * (1 + (15 / 100.0));
|
|
|
|
tPointsCarte[pas] = pointsCarte + pointsCarte * (1 + (15 / 100.0));
|
|
|
|
tCarteActive[pas] = 1;
|
|
|
|
tCarteActive[pas] = 1;
|
|
|
|
printf("Merci pour votre achat. Nous vous offrons 15%% supplémentaires. De plus, votre carte est active.\n");
|
|
|
|
printf("Merci pour votre achat. Nous vous offrons 15%% supplémentaires.\nDe plus, votre carte est active.\n");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("Le nombre de points est incorrect.\n");
|
|
|
|
printf("Le nombre de points est incorrect.\n");
|
|
|
|
printf("Veuillez ressaisir le nombre de points a ajouter: ");
|
|
|
|
printf("Veuillez ressaisir le nombre de points à ajouter : ");
|
|
|
|
scanf("%d", &pointsCarte);
|
|
|
|
scanf("%d", &pointsCarte);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
|
|
|
|
printf("Ce numéro d'adhérent n'existe pas. Veuillez réessayer.\n");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -62,7 +59,7 @@ void DebitActivitee(int tNoCarte[], int tCarteActive[], int tNbActivitesJour[],
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (tCarteActive[pas] == 1)
|
|
|
|
if (tCarteActive[pas] == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("Voulez-vous desactiver cette carte ? (O/N)\n");
|
|
|
|
printf("Voulez-vous désactiver cette carte ? (o/n)\n");
|
|
|
|
scanf("%*c%c", &reponse);
|
|
|
|
scanf("%*c%c", &reponse);
|
|
|
|
if (reponse == 'O' || reponse == 'o')
|
|
|
|
if (reponse == 'O' || reponse == 'o')
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -76,7 +73,7 @@ void DebitActivitee(int tNoCarte[], int tCarteActive[], int tNbActivitesJour[],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("La carte est desactivée. Voulez-vous la réactiver ? (O/N)\n");
|
|
|
|
printf("La carte est desactivée. Voulez-vous la réactiver ? (o/n)\n");
|
|
|
|
scanf("%*c%c", &reponse);
|
|
|
|
scanf("%*c%c", &reponse);
|
|
|
|
if (reponse == 'O' || reponse == 'o')
|
|
|
|
if (reponse == 'O' || reponse == 'o')
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -91,7 +88,7 @@ void DebitActivitee(int tNoCarte[], int tCarteActive[], int tNbActivitesJour[],
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
|
|
|
|
printf("Ce numéro d'adhérent n'existe pas. Veuillez réessayer.\n");
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|