Ajout et reformulation du travail de Kyllian et d'Ayour afin qu'il corresponde au programme mis en commun

master
Antoine PEREDERII 2 years ago
parent 74d638b020
commit eace96ceec

@ -1,10 +1,17 @@
01 500 1 500
02 550 2 525
03 600 3 740
04 520 4 812
05 500 5 850
06 515 6 620
07 500 7 601
08 612 8 422
09 705 9 501
10 800 1 500
2 525
3 740
4 812
5 850
6 620
7 601
8 422

430
SAE.c

@ -2,10 +2,9 @@
int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int tmax, int *pasAct) int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int tmax, int *pasAct)
{ {
int pasMembres, pasAct; int pasMembres;
pasMembres = OuvertureMembres(tNoCarte, tage, tPointsCarte, tCarteActive, tmax); pasMembres = OuvertureMembres(tNoCarte, tage, tPointsCarte, tCarteActive, tmax);
pasAct = OuvertureActivitesJour(tNbActivitesJour, tDate, tmax); *pasAct = OuvertureActivitesJour(tNbActivitesJour, tDate, tmax);
*pasAct = pasAct;
return pasMembres; return pasMembres;
} }
@ -15,13 +14,13 @@ int OuvertureMembres(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteA
int NoCarte, age, pointsCarte, CarteActive; int NoCarte, age, pointsCarte, CarteActive;
FILE *flot; FILE *flot;
flot = fopen("membres.don", "r"); flot = fopen("membres.don", "r");
if(flot == NULL) if (flot == NULL)
{ {
printf("Pb d'ouverture du fichier membres.don\n"); printf("Pb d'ouverture du fichier membres.don\n");
return -1; return -1;
} }
fscanf(flot, "%d%d%d%d", &NoCarte, &age, &pointsCarte, &CarteActive); fscanf(flot, "%d%d%d%d", &NoCarte, &age, &pointsCarte, &CarteActive);
while(!feof(flot)) while (!feof(flot))
{ {
if (i == tmax) if (i == tmax)
{ {
@ -45,15 +44,15 @@ int OuvertureActivitesJour(int tNbActivitesJour[], int tDate[], int tmax)
int Date, nbActivitesJour; int Date, nbActivitesJour;
FILE *jour; FILE *jour;
jour = fopen("ActivitesJour.don", "r"); jour = fopen("ActivitesJour.don", "r");
if(jour == NULL) if (jour == NULL)
{ {
printf("Pb d'ouverture du fichier ActivitesJour.don\n"); printf("Pb d'ouverture du fichier ActivitesJour.don\n");
return -1; return -1;
} }
fscanf(jour, "%d%d", &Date, &nbActivitesJour); fscanf(jour, "%d%d", &Date, &nbActivitesJour);
while(!feof(jour)) while (!feof(jour))
{ {
if(i == tmax) if (i == tmax)
{ {
printf("Tableau plein\n"); printf("Tableau plein\n");
fclose(jour); fclose(jour);
@ -91,95 +90,174 @@ int choixMenuAffichage(void)
printf("\t Gestion des matières\n"); printf("\t Gestion des matières\n");
printf("1.\tAffichage des informations d'un adhérent\n"); printf("1.\tAffichage des informations d'un adhérent\n");
printf("2.\tAffichage des informations de tous les adhérents\n"); printf("2.\tAffichage des informations de tous les adhérents\n");
printf("3.\tAffichage du nombre dentrées totale dans la journée\n"); printf("3.\tAffichage du nombre dentrées totale de toutes les journée\n");
printf("4.\tAffichage du nombre d'entrées totale de toutes les journées\n"); printf("4.\tAffichage du nombre d'entrées totale depuis le début\n");
printf("5.\tAffichage du nombre total d'adhérents\n"); printf("5.\tAffichage du nombre total d'adhérents\n");
printf("6.\tquitter\n"); printf("6.\tquitter\n");
printf("\noption choisie :\n"); printf("\noption choisie :\n");
scanf("%d", &choix); scanf("%d", &choix);
return choix; return choix;
} }
void Affichage1Adherent()
{
} int rechercheAdherent(int tNoCarte[], int nbelem, int NoCarte, int *trouve)
void AffichageTousAdherents()
{ {
int i;
for(i = 0; i < nbelem; i++)
{
if(tNoCarte[i] == NoCarte)
{
*trouve = 1;
return i;
}
if(tNoCarte[i] > NoCarte)
{
*trouve = 0;
return i;
}
}
}
int rechercheAdherent(int tNoCarte[], int tmax, int nbelem)
{
int i = 0, NoCarte;
printf("Entrez le numéro de la carte de l'adhérent recherché : ");
scanf("%d",&NoCarte);
while (i < tmax && tNoCarte[i] != NoCarte)
{
i++;
}
if (i == tmax)
{
printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
return -1;
}
else
{
return i;
}
} }
void AffichageNbEntreesJour()
void Affichage1Adherent(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int nbelem)
{ {
int pas, NoCarte, CarteActive, trouve;
printf("Entrez le numéro de la carte de l'adhérent recherché : ");
scanf("%d",&NoCarte);
pas = rechercheAdherant(tNoCarte, nbelem, NoCarte, &trouve);
if(trouve == 1)
{
printf(" N°_de_carte\tAge Points Carte_active\n");
printf("\t%d\t%d\t%d\t%d\n", tNoCarte[pas], tage[pas], tPointsCarte[pas], tCarteActive[pas]);
}
else
{
printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
return;
}
}
void AffichageTousAdherents(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int nbelem)
{
int i;
printf(" N°_de_carte\tAge Points Carte_active\n");
for (i = 0; i < nbelem; i++)
{
printf("\t%d\t%d\t%d\t%d\n", tNoCarte[i], tage[i], tPointsCarte[i], tCarteActive[i]);
}
} }
void AffichageNbEntreesTousJours() void AffichageNbEntreesTousJour(int tNbActivitesJour[], int tDate[], int nbelem)
{ {
int i;
printf(" Date\tNb_Activites\n");
for (i = 0; i < nbelem; i++)
{
printf("\t%d\t%d\n", tDate[i], tNbActivitesJour[i]);
}
} }
void AffichageNbAdherents() void AffichageNbEntreesTotal(int tNbActivitesJour[], int nbelem)
{ {
int i, somme = 0;
for (i = 0; i < nbelem; i++)
{
somme = somme + tNbActivitesJour[i];
}
printf("Le nombre total d'entrées est de %d depuis le début.\n", somme);
}
void AffichageNbAdherents(int nbelem)
{
int i, somme = 0;
for (i = 0; i < nbelem; i++)
{
somme = somme + 1;
}
printf("Le nombre total d'adhérents est de %d.\n", somme);
} }
void gestionMenus(void) void gestionMenus(void)
{ {
int tNoCarte[20] = {0}, tage[20] = {0}, tPointsCarte[20] = {0}, tCarteActive[20] = {0}; int tNoCarte[20] = {0}, tage[20] = {0}, tPointsCarte[20] = {0}, tCarteActive[20] = {0};
int tDate[20] = {0}, tNbActivitesJour[20] = {0}; int tDate[20] = {0}, tNbActivitesJour[20] = {0};
int tmax = 20, nbelem, choix, pasAct; int tmax = 20, nbelem, choix, pasAct;
nbelem = Ouverture(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, tmax, &pasAct); nbelem = Ouverture(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, tmax, &pasAct);
if(nbelem < 0) if (nbelem < 0)
{ {
printf("Erreur d'ouverture du fichier ou tableau plein !!!\n"); printf("Erreur d'ouverture du fichier ou tableau plein !!!\n");
return ; return;
} }
choix = choixMenu(); choix = choixMenu();
while(choix != 8) while (choix != 8)
{ {
if(choix == 1) if (choix == 1)
{ {
choix = choixMenuAffichage(); choix = choixMenuAffichage();
while(choix != 6) while (choix != 6)
{ {
if(choix == 1) if (choix == 1)
{ {
Affichage1Adherent(tNoCarte, tage, tPointsCarte, tCarteActive, nbelem);
} }
if(choix == 2) if (choix == 2)
{ {
AffichageTousAdherents(tNoCarte, tage, tPointsCarte, tCarteActive, nbelem);
} }
if(choix == 3) if (choix == 3)
{ {
AffichageNbEntreesTousJour(tNbActivitesJour, tDate, nbelem);
} }
if(choix == 4) if (choix == 4)
{ {
AffichageNbEntreesTotal(tNbActivitesJour, nbelem);
} }
if(choix == 5) if (choix == 5)
{ {
AffichageNbAdherents(nbelem);
} }
choix = choixMenuAffichage(); choix = choixMenuAffichage();
} }
} }
if(choix == 2) if (choix == 2)
{ {
nbelem = AjoutAdherent(tNoCarte, tage, tPointsCarte, tCarteActive, tmax, nbelem);
} }
if(choix == 3) if (choix == 3)
{ {
ModificationAge(tNoCarte, tage, nbelem);
} }
if(choix == 4) if (choix == 4)
{ {
nbelem = SupprimmerAdherent(tNoCarte, tage, tPointsCarte, tCarteActive, nbelem);
} }
if(choix == 5) if (choix == 5)
{ {
AjoutPoints(tNoCarte, tPointsCarte, nbelem);
} }
if(choix == 6) if (choix == 6)
{ {
}
if (choix == 7)
{
} }
choix = choixMenu(); choix = choixMenu();
} }
@ -187,135 +265,237 @@ void gestionMenus(void)
exit(1); exit(1);
} }
int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem) void ModificationAge(int tNoCarte[], int tage[], int nbelem)
{ {
int i, j; int pas, NoCarte, age;
FILE *flot, *jour; printf("Entrez le numéro de la carte de l'adhérent recherché : ");
flot = fopen("membres.don", "a"); scanf("%d",&NoCarte);
jour = fopen("ActivitesJour.don", "a"); pas = rechercheAdherant(tNoCarte, nbelem, NoCarte, &trouve);
if(flot == NULL) if(trouve == 1)
{
printf("Pb d'ouverture du fichier membres.don\n");
return -1;
}
if(jour == NULL)
{ {
printf("Pb d'ouverture du fichier ActivitesJour.don\n"); printf("Entrez l'age de l'adhérent : ");
return -1; scanf("%d",&age);
tage[pas] = age;
} }
for(i = 0; i < (nbelem-1); i++) else
{
fprintf(flot, "\t%d\t%d\t\t%d\t\t%d\n", tNoCarte[i], tage[i], tPointsCarte[i], tCarteActive[i]);
}
for(j = 0; j < (nbelem-1); j++)
{ {
fprintf(jour, "%d\t\t%d\n", tDate[j], tNbActivitesJour[j]); printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
return;
} }
fclose(jour);
fclose(flot);
} }
void ajouterPoints(int tNumCarte[], int tPoints[], int tailleLog) int SupprimmerAdherent(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int nbelem)
{ {
int pas, i, NoCarte, trouve;
int numCarte, nbPoints, trouve, index; printf("Entrez le numéro de la carte de l'adhérent recherché : ");
char choix; scanf("%d",&NoCarte);
pas = rechercheAdherant(tNoCarte, nbelem, NoCarte, &trouve);
printf("Entrez le numéro d'adhérent : "); if(trouve == 1)
scanf("%d", &numCarte); {
index = recherche(tNumCarte, tailleLog, numCarte, &trouve); for(i = pas; i < nbelem; i++)
while (trouve == 0) {
{ tNoCarte[i] = tNoCarte[i+1];
printf("Numéro de carte non trouvé. Veuillez réessayer.\nEntrez le numéro d'adhérent : "); tage[i] = tage[i+1];
scanf("%d", &numCarte); tPointsCarte[i] = tPointsCarte[i+1];
index = recherche(tNumCarte, tailleLog, numCarte, &trouve); tCarteActive[i] = tCarteActive[i+1];
} }
printf("Entrez le nombre de points à ajouter : "); nbelem = nbelem - 1;
scanf("%d", &nbPoints); return nbelem;
printf("Vous voulez bien ajouter %d points à la carte n°%d ? (O/n)", nbPoints, numCarte);
scanf("%c%*c", &choix);
if (choix == 'n' || choix == 'N') {
printf("Annulation");
} }
else else
{ {
modifierPoints(tNumCarte, tPoints, tailleLog, numCarte, nbPoints); printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
return -1;
} }
} }
int modifierPoints(int tNumCarte[], int tPoints[], int tailleLog, int numCarte, int nbPoints) int AjoutAdherent(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tmax, int nbelem)
{ {
int index, trouve; int NoCarte, age, pointsCarte, CarteActive, pas;
char reponse;
index = recherche(tNumCarte, tailleLog, numCarte, &trouve); printf("Donnez l'âge de l'adhérent :\n");
scanf("%d", &age);
if (trouve == 0) pas = rechercheAdherant(tNoCarte, nbelem);
for(j=nbelem; j> pas; j--)
{
if(j == tmax)
{
printf("Tableau plein, impossible d'ajouter un adhérent\n");
return -1;
}
tNoCarte[j] = tNoCarte[j-1];
tage[j] = tage[j-1];
tPointsCarte[j] = tPointsCarte[j-1];
tCarteActive[j] = tCarteActive[j-1];
}
tNoCarte[pas] = pas + 1;
tage[pas] = age;
tPointsCarte[pas] = 0;
tCarteActive[pas] = 0;
nbelem++;
printf("Le numero de carte de l'adherent qui a %d ans est %d.\nLa carte n'est pas active car il n'y a pas de points dessus.\nVoulez-vous en ajouter ? (O / N)", tage[pas], tNoCarte[pas]);
scanf("%*c%c", &reponse);
if(reponse == 'O' || reponse == 'o')
{ {
printf("Numéro de carte non trouvé. Annulation de l'opétation."); AjoutPoints(tNoCarte, tPointsCarte, tCarteActive, nbelem, pas);
return 0;
} }
else else
{ {
tPoints[index] += nbPoints; printf("La carte n'est pas active.\n");
return 1; return nbelem;
} }
return nbelem;
} }
int recherche(int tab[], int tailleLog, int valeur, int *trouve) void AjoutPoints(int tNoCarte[], int tPointsCarte[], int tCarteActive[], int nbelem, int pas)
{ {
for (int i = 0; i < tailleLog; i++) int pointsCarte, NoCarte, trouve;
printf("Entrez le numéro de la carte de l'adhérent recherché : ");
scanf("%d",&NoCarte);
pas = rechercheAdherant(tNoCarte, nbelem, NoCarte, &trouve);
if(trouve == 1)
{ {
if (tab[i] == valeur) printf("Entrez le nombre de points a ajouter: ");
scanf("%d", &pointsCarte);
if(pointsCarte > 0 && pointsCarte < 20)
{ {
*trouve = 1; tPointsCarte[pas] = pointsCarte;
return i; tCarteActive[pas] = 1;
printf("La carte est active.\n");
} }
else if (tab[i] > valeur) if(pointsCarte > 20 && pointsCarte < 50)
{ {
*trouve = 0; tPointsCarte[pas] = pointsCarte + pointsCarte*(1 + (5/100.0));
return i; tCarteActive[pas] = 1;
printf("Merci pour votre achat. Nous vous offrons 5%% supplémentaires. De plus, votre carte est active.\n");
}
if(pointsCarte > 50 && pointsCarte < 100)
{
tPointsCarte[pas] = pointsCarte + pointsCarte*(1 + (10/100.0));
tCarteActive[pas] = 1;
printf("Merci pour votre achat. Nous vous offrons 10%% supplémentaires. De plus, votre carte est active.\n");
}
if(pointsCarte > 100)
{
tPointsCarte[pas] = pointsCarte + pointsCarte*(1 + (15/100.0));
tCarteActive[pas] = 1;
printf("Merci pour votre achat. Nous vous offrons 15%% supplémentaires. De plus, votre carte est active.\n");
}
else
{
printf("Le nombre de points est incorrect.\n");
printf("Veuillez ressaisir le nombre de points a ajouter: ");
scanf("%d", &pointsCarte);
} }
} }
*trouve = 0; else
return tailleLog; {
printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
return -1;
}
} }
void modifierAge(int tNumCarte[], int tAge[], int tailleLog) int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem)
{ {
int numCarte, age, index, trouve; int i, j;
char choix; FILE *flot, *jour;
printf("Entrez le numéro d'adhérent : "); flot = fopen("membres.don", "a");
scanf("%d", &numCarte); jour = fopen("ActivitesJour.don", "a");
index = recherche(tNumCarte, tailleLog, numCarte, &trouve); if (flot == NULL)
while (trouve == 0)
{ {
printf("Numéro de carte non trouvé. Veuillez réessayer.\nEntrez le numéro d'adhérent : "); printf("Pb d'ouverture du fichier membres.don\n");
scanf("%d", &numCarte); return -1;
index = recherche(tNumCarte, tailleLog, numCarte, &trouve); }
if (jour == NULL)
{
printf("Pb d'ouverture du fichier ActivitesJour.don\n");
return -1;
}
for (i = 0; i < (nbelem - 1); i++)
{
fprintf(flot, "\t%d\t%d\t\t%d\t\t%d\n", tNoCarte[i], tage[i], tPointsCarte[i], tCarteActive[i]);
}
for (j = 0; j < (nbelem - 1); j++)
{
fprintf(jour, "%d\t\t%d\n", tDate[j], tNbActivitesJour[j]);
} }
fclose(jour);
fclose(flot);
}
printf("Entrez le nouvel âge :"); void ModificationActivationCarte(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int nbelem)
scanf("%d", &age); {
while (age <= 0) int NoCarte, trouve, pas;
printf("Entrez le numéro de la carte de l'adhérent recherché : ");
scanf("%d",&NoCarte);
pas = rechercheAdherant(tNoCarte, nbelem, NoCarte, &trouve);
if(trouve == 1)
{
if(tCarteActive[pas] == 1)
{
tCarteActive[pas] = 0;
printf("La carte est desactivée.\n");
}
else
{
tCarteActive[pas] = 1;
printf("La carte est activée.\n");
}
}
else
{ {
printf("Âge non valide. Veuillez réessayer.\nEntrez le nouvel âge : "); printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
scanf("%d", &age); return -1;
} }
}
printf("Le nouvel âge du client n°%d est bien %d ? (O/n)", numCarte, age); void DebitActivitee(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem)
scanf("%c%*c", &choix); {
if (choix == 'n' || choix == 'N') int NoCarte, trouve, pas, pointsCarte;
char reponse;
printf("Entrez le numéro de la carte de l'adhérent recherché : ");
scanf("%d",&NoCarte);
pas = rechercheAdherant(tNoCarte, nbelem, NoCarte, &trouve);
if(trouve == 1)
{ {
printf("Annulation"); if(tCarteActive[pas] == 1)
return; {
printf("Voulez-vous desactiver cette carte ? (O/N)\n");
scanf("%*c%c", &reponse);
if(reponse == 'O' || reponse == 'o')
{
tCarteActive[pas] = 0;
printf("La carte est desactivée.\n");
}
else
{
printf("La carte est toujours active.\n");
}
}
else
{
printf("La carte est desactivée. Voulez-vous la réactiver ? (O/N)\n");
scanf("%*c%c", &reponse);
if(reponse == 'O' || reponse == 'o')
{
tCarteActive[pas] = 1;
printf("La carte est activée.\n");
}
else
{
printf("La carte est toujours desactivée.\n");
}
}
} }
else else
{ {
tAge[index] = age; printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n");
return; return -1;
} }
} }
/* /*
int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem) int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem)
{ {

25
SAE.h

@ -2,32 +2,35 @@
#include <stdlib.h> #include <stdlib.h>
/* Fonctions Ouverture des fichiers textes */ /* Fonctions Ouverture des fichiers textes */
int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int tmax, int *pasAct);
int OuvertureMembres(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tmax); int OuvertureMembres(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tmax);
int OuvertureActivitesJour(int tNbActivitesJour[], int tDate[], int tmax); int OuvertureActivitesJour(int tNbActivitesJour[], int tDate[], int tmax);
void testOuverture(); void testOuverture(void);
/* Fonctions des menus */ /* Fonctions des menus */
void choixMenu(); int choixMenu(void);
void choixMenuAffichage(); int choixMenuAffichage(void);
/* Fonctions d'affichage */ /* Fonctions d'affichage */
void Affichage1Adherent(); void Affichage1Adherent(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int nbelem);
void AffichageTousAdherents(); void AffichageTousAdherents(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int nbelem);
void AffichageNbEntreesJour(); void AffichageNbEntreesTousJours(int tNbActivitesJour[], int tDate[], int nbelem);
void AffichageNbEntreesTousJours(); void AffichageNbEntreesTotal(int tNbActivitesJour[], int nbelem);
void AffichageNbAdherents(); void AffichageNbAdherents(int nbelem);
/* Fonction global */ /* Fonction global */
void gestionMenus(void); void gestionMenus(void);
/* Fonction Sauvegarde */ /* Fonction Sauvegarde */
int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], inttNbActivitesJour[], int tDate[], int nbelem); int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem);
void testSauvegarde(void);
/* Fonctions de gestion des adherents */ /* Fonctions de gestion des adherents */
int rechercheAdherant (int tNoCarte[], int nbelem);
int AjoutAdherent(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tmax, int nbelem);
void ModificationAge(int tNoCarte[], int tage[], int nbelem);
/* Fonstions de gestion des points */ /* Fonstions de gestion des points */
void ajouterPoints(int tNumCarte[], int tPoints[], int tailleLog); void ajouterPoints(int tNumCarte[], int tPoints[], int tailleLog);
int recherche(int tab[], int tailleLog, int valeur, int *trouve); int recherche(int tab[], int tailleLog, int valeur, int *trouve);
int modifierPoints(int tNumCarte[], int tPoints[], int tailleLog, int numCarte, int points); int modifierPoints(int tNumCarte[], int tPoints[], int tailleLog, int numCarte, int points);
void modifierAge(int tNumCarte[], int tAge[], int tailleLog);

BIN
exe

Binary file not shown.

@ -1,9 +1,17 @@
1 22 10 0 1 22 10 0
2 25 5 1 2 25 5 1
3 47 7 1 3 47 7 1
4 38 8 1 4 38 8 1
5 18 8 1 5 18 8 1
6 46 6 1 6 46 6 1
7 36 6 0 7 36 6 0
8 19 2 1 8 19 2 1
9 21 1 1 9 21 1 1
1 22 10 0
2 25 5 1
3 47 7 1
4 38 8 1
5 18 8 1
6 46 6 1
7 36 6 0
8 19 2 1

@ -5,25 +5,24 @@ void testOuverture(void)
int tNoCarte[20] = {0}, tage[20] = {0}, tPointsCarte[20] = {0}, tCarteActive[20] = {0}; int tNoCarte[20] = {0}, tage[20] = {0}, tPointsCarte[20] = {0}, tCarteActive[20] = {0};
int tDate[20] = {0}, tNbActivitesJour[20] = {0}; int tDate[20] = {0}, tNbActivitesJour[20] = {0};
int tmax = 20, pasMembres, pasAct, i; int tmax = 20, pasMembres, pasAct, i;
pasMembres = OuvertureMembres(tNoCarte, tage, tPointsCarte, tCarteActive, tmax); pasMembres = Ouverture(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, tmax, &pasAct);
pasAct = OuvertureActivitesJour(tNbActivitesJour, tDate, tmax); printf("Pas membre: %d\nPas Act : %d\n", pasMembres, pasAct);
printf("Pas membre: %d\nPas Act : %d\n", &pasMembres, &pasAct);
printf("Ncarte age pointsCarte carteActive nbActivitesJour Date taillemax\n"); printf("Ncarte age pointsCarte carteActive nbActivitesJour Date taillemax\n");
for(i=0; i < pasMembres; i++) for(i=0; i < pasMembres; i++)
printf("%d\t%d\t%d\t%d\t\t%d\t\t%d\t%d\n", tNoCarte[i], tage[i], tPointsCarte[i], tCarteActive[i], tNbActivitesJour[i], tDate[i], tmax); printf("%d\t%d\t%d\t%d\t\t%d\t\t%d\t%d\n", tNoCarte[i], tage[i], tPointsCarte[i], tCarteActive[i], tNbActivitesJour[i], tDate[i], tmax);
} }
/*
void testSauvegarde(void) void testSauvegarde(void)
{ {
int tNoCarte[500] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, tage[500] = {22, 25, 47, 38, 18, 46, 36, 19, 21, 30}, tPointsCarte[500] = {10, 5, 7, 8, 8, 6, 6, 2, 1, 4}, tCarteActive[500] = {0, 1, 1, 1, 1, 1, 0, 1, 1, 1}; int tNoCarte[500] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, tage[500] = {22, 25, 47, 38, 18, 46, 36, 19, 21, 30}, tPointsCarte[500] = {10, 5, 7, 8, 8, 6, 6, 2, 1, 4}, tCarteActive[500] = {0, 1, 1, 1, 1, 1, 0, 1, 1, 1};
int tDate[500] = {12082022, 5092022, 7092022, 8092022, 9092022, 10092022, 11092022, 12092022, 13092022, 14092022}, tNbActivitesJour[500] = {500, 525, 740, 812, 850, 620, 601, 422, 501, 520}; int tDate[500] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}, tNbActivitesJour[500] = {500, 525, 740, 812, 850, 620, 601, 422, 501, 520};
Sauvegarde(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, 10); Sauvegarde(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, 10);
} }
*/
int main(void) int main(void)
{ {
testOuverture(); //testOuverture();
//testSauvegarde(); //testSauvegarde();
gestionMenus();
return 0; return 0;
} }
Loading…
Cancel
Save