From eace96ceec6e12a03ed79765c6dc2f38affbac6c Mon Sep 17 00:00:00 2001 From: "antoine.perederii" Date: Thu, 10 Nov 2022 00:36:18 +0100 Subject: [PATCH] Ajout et reformulation du travail de Kyllian et d'Ayour afin qu'il corresponde au programme mis en commun --- ActivitesJour.don | 27 +-- SAE.c | 436 ++++++++++++++++++++++++++++++++-------------- SAE.h | 27 +-- exe | Bin 17016 -> 21880 bytes membres.don | 26 ++- testSAE.c | 13 +- 6 files changed, 363 insertions(+), 166 deletions(-) diff --git a/ActivitesJour.don b/ActivitesJour.don index fdd8e5c..e6eb2bd 100644 --- a/ActivitesJour.don +++ b/ActivitesJour.don @@ -1,10 +1,17 @@ -01 500 -02 550 -03 600 -04 520 -05 500 -06 515 -07 500 -08 612 -09 705 -10 800 +1 500 +2 525 +3 740 +4 812 +5 850 +6 620 +7 601 +8 422 +9 501 +1 500 +2 525 +3 740 +4 812 +5 850 +6 620 +7 601 +8 422 diff --git a/SAE.c b/SAE.c index fe96184..f9e8d7b 100644 --- a/SAE.c +++ b/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 pasMembres, pasAct; + int pasMembres; pasMembres = OuvertureMembres(tNoCarte, tage, tPointsCarte, tCarteActive, tmax); - pasAct = OuvertureActivitesJour(tNbActivitesJour, tDate, tmax); - *pasAct = pasAct; + *pasAct = OuvertureActivitesJour(tNbActivitesJour, tDate, tmax); return pasMembres; } @@ -15,13 +14,13 @@ int OuvertureMembres(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteA int NoCarte, age, pointsCarte, CarteActive; FILE *flot; flot = fopen("membres.don", "r"); - if(flot == NULL) + if (flot == NULL) { printf("Pb d'ouverture du fichier membres.don\n"); return -1; } fscanf(flot, "%d%d%d%d", &NoCarte, &age, &pointsCarte, &CarteActive); - while(!feof(flot)) + while (!feof(flot)) { if (i == tmax) { @@ -33,7 +32,7 @@ int OuvertureMembres(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteA tage[i] = age; tPointsCarte[i] = pointsCarte; tCarteActive[i] = CarteActive; - fscanf(flot, "%d%d%d%d", &NoCarte, &age, &pointsCarte, &CarteActive); + fscanf(flot, "%d%d%d%d", &NoCarte, &age, &pointsCarte, &CarteActive); i++; } fclose(flot); @@ -45,15 +44,15 @@ int OuvertureActivitesJour(int tNbActivitesJour[], int tDate[], int tmax) int Date, nbActivitesJour; FILE *jour; jour = fopen("ActivitesJour.don", "r"); - if(jour == NULL) + if (jour == NULL) { printf("Pb d'ouverture du fichier ActivitesJour.don\n"); return -1; } fscanf(jour, "%d%d", &Date, &nbActivitesJour); - while(!feof(jour)) + while (!feof(jour)) { - if(i == tmax) + if (i == tmax) { printf("Tableau plein\n"); fclose(jour); @@ -91,95 +90,174 @@ int choixMenuAffichage(void) printf("\t Gestion des matières\n"); printf("1.\tAffichage des informations d'un adhérent\n"); printf("2.\tAffichage des informations de tous les adhérents\n"); - printf("3.\tAffichage du nombre d’entrées totale dans la journée\n"); - printf("4.\tAffichage du nombre d'entrées totale de toutes les journées\n"); + printf("3.\tAffichage du nombre d’entrées totale de toutes les journée\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("6.\tquitter\n"); printf("\noption choisie :\n"); scanf("%d", &choix); return choix; } -void Affichage1Adherent() -{ -} -void AffichageTousAdherents() +int rechercheAdherent(int tNoCarte[], int nbelem, int NoCarte, int *trouve) { + 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) { int tNoCarte[20] = {0}, tage[20] = {0}, tPointsCarte[20] = {0}, tCarteActive[20] = {0}; int tDate[20] = {0}, tNbActivitesJour[20] = {0}; int tmax = 20, nbelem, choix, 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"); - return ; + return; } choix = choixMenu(); - while(choix != 8) + while (choix != 8) { - if(choix == 1) + if (choix == 1) { 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(); } } - 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(); } @@ -187,135 +265,237 @@ void gestionMenus(void) 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; - FILE *flot, *jour; - flot = fopen("membres.don", "a"); - jour = fopen("ActivitesJour.don", "a"); - if(flot == NULL) - { - printf("Pb d'ouverture du fichier membres.don\n"); - return -1; - } - if(jour == NULL) + int pas, NoCarte, age; + 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("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]); + printf("Entrez l'age de l'adhérent : "); + scanf("%d",&age); + tage[pas] = age; } - for(j = 0; j < (nbelem-1); j++) + else { - 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 numCarte, nbPoints, trouve, index; - char choix; - - printf("Entrez le numéro d'adhérent : "); - scanf("%d", &numCarte); - index = recherche(tNumCarte, tailleLog, numCarte, &trouve); - while (trouve == 0) - { - printf("Numéro de carte non trouvé. Veuillez réessayer.\nEntrez le numéro d'adhérent : "); - scanf("%d", &numCarte); - index = recherche(tNumCarte, tailleLog, numCarte, &trouve); - } - printf("Entrez le nombre de points à ajouter : "); - scanf("%d", &nbPoints); - 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"); + int pas, i, 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) + { + for(i = pas; i < nbelem; i++) + { + tNoCarte[i] = tNoCarte[i+1]; + tage[i] = tage[i+1]; + tPointsCarte[i] = tPointsCarte[i+1]; + tCarteActive[i] = tCarteActive[i+1]; + } + nbelem = nbelem - 1; + return nbelem; } 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; - - index = recherche(tNumCarte, tailleLog, numCarte, &trouve); - - if (trouve == 0) + int NoCarte, age, pointsCarte, CarteActive, pas; + char reponse; + printf("Donnez l'âge de l'adhérent :\n"); + scanf("%d", &age); + pas = rechercheAdherant(tNoCarte, nbelem); + for(j=nbelem; j> pas; j--) { - printf("Numéro de carte non trouvé. Annulation de l'opétation."); - return 0; + 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') + { + AjoutPoints(tNoCarte, tPointsCarte, tCarteActive, nbelem, pas); } else { - tPoints[index] += nbPoints; - return 1; + printf("La carte n'est pas active.\n"); + 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; - return i; + tPointsCarte[pas] = pointsCarte; + tCarteActive[pas] = 1; + printf("La carte est active.\n"); } - else if (tab[i] > valeur) + if(pointsCarte > 20 && pointsCarte < 50) { - *trouve = 0; - return i; + tPointsCarte[pas] = pointsCarte + pointsCarte*(1 + (5/100.0)); + 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; - return tailleLog; + else + { + 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; - char choix; - printf("Entrez le numéro d'adhérent : "); - scanf("%d", &numCarte); - index = recherche(tNumCarte, tailleLog, numCarte, &trouve); - while (trouve == 0) + int i, j; + FILE *flot, *jour; + flot = fopen("membres.don", "a"); + jour = fopen("ActivitesJour.don", "a"); + if (flot == NULL) + { + printf("Pb d'ouverture du fichier membres.don\n"); + return -1; + } + if (jour == NULL) { - printf("Numéro de carte non trouvé. Veuillez réessayer.\nEntrez le numéro d'adhérent : "); - scanf("%d", &numCarte); - index = recherche(tNumCarte, tailleLog, numCarte, &trouve); + 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 :"); - scanf("%d", &age); - while (age <= 0) +void ModificationActivationCarte(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int nbelem) +{ + 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 : "); - scanf("%d", &age); + printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n"); + return -1; } +} - printf("Le nouvel âge du client n°%d est bien %d ? (O/n)", numCarte, age); - scanf("%c%*c", &choix); - if (choix == 'n' || choix == 'N') +void DebitActivitee(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem) +{ + 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"); - return; + if(tCarteActive[pas] == 1) + { + 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 { - tAge[index] = age; - return; + printf("Ce numéro d'adhérant n'existe pas, veuillez réessayer\n"); + return -1; } } + /* int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem) { diff --git a/SAE.h b/SAE.h index 086eccb..edaf05b 100644 --- a/SAE.h +++ b/SAE.h @@ -2,32 +2,35 @@ #include /* 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 OuvertureActivitesJour(int tNbActivitesJour[], int tDate[], int tmax); -void testOuverture(); +void testOuverture(void); /* Fonctions des menus */ -void choixMenu(); -void choixMenuAffichage(); +int choixMenu(void); +int choixMenuAffichage(void); /* Fonctions d'affichage */ -void Affichage1Adherent(); -void AffichageTousAdherents(); -void AffichageNbEntreesJour(); -void AffichageNbEntreesTousJours(); -void AffichageNbAdherents(); +void Affichage1Adherent(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int nbelem); +void AffichageTousAdherents(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int nbelem); +void AffichageNbEntreesTousJours(int tNbActivitesJour[], int tDate[], int nbelem); +void AffichageNbEntreesTotal(int tNbActivitesJour[], int nbelem); +void AffichageNbAdherents(int nbelem); /* Fonction global */ void gestionMenus(void); /* 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 */ - +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 */ void ajouterPoints(int tNumCarte[], int tPoints[], int tailleLog); int recherche(int tab[], int tailleLog, int valeur, int *trouve); -int modifierPoints(int tNumCarte[], int tPoints[], int tailleLog, int numCarte, int points); -void modifierAge(int tNumCarte[], int tAge[], int tailleLog); \ No newline at end of file +int modifierPoints(int tNumCarte[], int tPoints[], int tailleLog, int numCarte, int points); \ No newline at end of file diff --git a/exe b/exe index 2e56178690e22cb21a676c249274dfa185731b5b..35b28048e24e2e3d0ddd285f9a1da0fc58f35528 100755 GIT binary patch literal 21880 zcmeHPe{@vUoxe#y140r7F)GMYp+Hy0fcyvuB?B29+yto*u~j-uG7~a3nMvmd21{Dp zFs{>aTDmJ9dg>mtwe6AqSm_VCXl)ybZP2pa*hQOFYEz5tq(O}>Zetgn{e17e-}m0U zOkDry*|R+-7c$@P{rI7QLV>uXE>+> z!I0xgF`>VwwLK@S1&<0tlBKfw)p&sLgDYfp3_PjGf+6dD7<%OA`z;*yTXcKl#idgF z&ro+)T-zFIT(Ruh*1+P{P&m=CxTAW-;uXtWv50G_?DtGKLOFHgrUvn2?@zbRdv?o( z+v@Le&tCAt{)Y!Vwd6PXK=w$63dwW$36|lH_^My`08=!A&jo+hMsU261j8u6oDbSX z1?ZQLLtj1)ozkI@oh{?g*Nj6q#-aZ+=)`jtibbJzr;S4|8i#%ubOV3RQVYUWP9oKV z9ig~rjtCZfZRLjAW&KN3r!Cyj4q0D{ zdh>qNWm)pt#?*5k^QK<$cAXyCytOVfd37bamYMz^mk?O{7(njg-+oAlv*mMf_y8#c z1K!N!Mgprw;};_wKLnq`F(o%xK6ft}?$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4$pZD7^fiJOd6SrKVpnlFh}YbRwy+@7~CDQaLR zxP zo_0L?Zf_WZDL_y$!B>UH3b zZPMgJ>k&pOtK#FaHAND+i`O-_rg%))Tq=aw*rwv1AdmZ;4VHIrD$X`=(W$`B?LYZH DlS%#S diff --git a/membres.don b/membres.don index b4f1f63..0646c94 100644 --- a/membres.don +++ b/membres.don @@ -1,9 +1,17 @@ -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 -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 + 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 diff --git a/testSAE.c b/testSAE.c index 2e999a0..77b6051 100644 --- a/testSAE.c +++ b/testSAE.c @@ -5,25 +5,24 @@ void testOuverture(void) int tNoCarte[20] = {0}, tage[20] = {0}, tPointsCarte[20] = {0}, tCarteActive[20] = {0}; int tDate[20] = {0}, tNbActivitesJour[20] = {0}; int tmax = 20, pasMembres, pasAct, i; - pasMembres = OuvertureMembres(tNoCarte, tage, tPointsCarte, tCarteActive, tmax); - pasAct = OuvertureActivitesJour(tNbActivitesJour, tDate, tmax); - printf("Pas membre: %d\nPas Act : %d\n", &pasMembres, &pasAct); + pasMembres = Ouverture(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, tmax, &pasAct); + printf("Pas membre: %d\nPas Act : %d\n", pasMembres, pasAct); printf("Ncarte age pointsCarte carteActive nbActivitesJour Date taillemax\n"); 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); } -/* 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 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); } -*/ + int main(void) { - testOuverture(); + //testOuverture(); //testSauvegarde(); + gestionMenus(); return 0; } \ No newline at end of file