From 8ecbc3bf6bcdfc4fa853aa54c41f42d9a629b724 Mon Sep 17 00:00:00 2001 From: IA Date: Wed, 9 Nov 2022 21:02:39 +0100 Subject: [PATCH 1/6] ajout de la fonction menu et patch de la fonction ouverture --- ActivitesJour.don | 20 +++--- SAE.c | 171 +++++++++++++++++++++++++++++++++------------- SAE.h | 6 +- exe | Bin 17048 -> 17016 bytes membres.don | 19 +++--- testSAE.c | 24 ++++--- 6 files changed, 161 insertions(+), 79 deletions(-) diff --git a/ActivitesJour.don b/ActivitesJour.don index af64d63..fdd8e5c 100644 --- a/ActivitesJour.don +++ b/ActivitesJour.don @@ -1,10 +1,10 @@ - Date nbActivitesJour -12082022 500 -5092022 525 -7092022 740 -8092022 812 -9092022 850 -10092022 620 -11092022 601 -12092022 422 -13092022 501 +01 500 +02 550 +03 600 +04 520 +05 500 +06 515 +07 500 +08 612 +09 705 +10 800 diff --git a/SAE.c b/SAE.c index 03ce7b2..c4d3292 100644 --- a/SAE.c +++ b/SAE.c @@ -1,25 +1,26 @@ #include "SAE.h" -int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int tmax) +int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int tmax, int *pasAct) { - int i = 0, j = 0; + int pasMembres, pasAct; + pasMembres = OuvertureMembres(tNoCarte, tage, tPointsCarte, tCarteActive, tmax); + pasAct = OuvertureActivitesJour(tNbActivitesJour, tDate, tmax); + *pasAct = pasAct; + return pasMembres +} + +int OuvertureMembres(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tmax) +{ + int i = 0; int NoCarte, age, pointsCarte, CarteActive; - int Date, nbActivitesJour; - FILE *flot, *jour; + FILE *flot; flot = fopen("membres.don", "r"); - jour = fopen("ActivitesJour.don", "r"); if(flot == NULL) { printf("Pb d'ouverture du fichier membres.don\n"); return -1; } - if(jour == NULL) - { - printf("Pb d'ouverture du fichier ActivitesJour.don\n"); - return -1; - } - fscanf(flot, "%d%d%d%d%d%d%d", &NoCarte, &age, &pointsCarte, &CarteActive); - fscanf(jour, "%d%d", &Date, &nbActivitesJour); + fscanf(flot, "%d%d%d%d", &NoCarte, &age, &pointsCarte, &CarteActive); while(!feof(flot)) { if(i == tmax) @@ -32,27 +33,131 @@ int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[] 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); + return i; +} +int OuvertureActivitesJour(int tNbActivitesJour[], int tDate[], int tmax) +{ + int i = 0; + int Date, nbActivitesJour; + FILE *jour; + jour = fopen("ActivitesJour.don", "r"); + if(jour == NULL) + { + printf("Pb d'ouverture du fichier ActivitesJour.don\n"); + return -1; + } + fscanf(jour, "%d%d", &Date, &nbActivitesJour); while(!feof(jour)) { - if(j == tmax) + if(i == tmax) { printf("Tableau plein\n"); fclose(jour); return -1; } - tDate[j] = Date; - tNbActivitesJour[j] = nbActivitesJour; + tDate[i] = Date; + tNbActivitesJour[i] = nbActivitesJour; fscanf(jour, "%d%d", &Date, &nbActivitesJour); - j++; + i++; } fclose(jour); - fclose(flot); return i; } +int choixMenu(void) +{ + int choix; + printf("\t Gestion des matières\n"); + printf("1.\taffichage\n"); + printf("2.\tAjouter un client\n"); + printf("3.\tModifier l'âge d'un client\n"); + printf("4.\tsuppression d'un client\n"); + printf("5.\tAjout de points sur une carte\n"); + printf("6.\tModification de l'état de la carte\n"); + printf("7.\tCréditer une activité à une carte\n"); + printf("8.\tquitter\n"); + printf("\noption choisie :\n"); + scanf("%d", &choix); + return choix; +} + +void gestionMatieres(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(nbMatieres < 0) + { + printf("Erreur d'ouverture du fichier ou tableau plein !!!\n"); + return ; + } + choix = choixMenu(); + while(choix != 9) + { + if(choix == 1) + { + affichage(tMatieres, tCoeff, nbMatieres); + } + if(choix == 2) + { + modificationCoefficient(tMatieres, tCoeff, nbMatieres); + } + if(choix == 3) + { + nbMatieres = insertionNewMatiere(tMatieres, tCoeff, nbMatieres, max); + } + if(choix == 4) + { + nbMatieres = suppressionMatiere(tMatieres, tCoeff, nbMatieres); + } + if(choix == 5) + { + MoyenneNotesMatiere(tMatieres, tNotes, tNbNotes, nbMatieres); + } + if(choix == 6) + { + MoyenneEtudiant(tCoeff, tMatieres, tNotes, tNbNotes, nbMatieres); + } + choix = choixMenu(); + } + sauvegarde(tMatieres, tCoeff, nbMatieres); + fclose(flot); + exit(1); +} +/* +int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], 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) + { + 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); +} + void ajouterPoints(int tNumCarte[], int tPoints[], int tailleLog) { @@ -118,36 +223,10 @@ int recherche(int tab[], int tailleLog, int valeur, int *trouve) return tailleLog; } -/* -int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], 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) - { - 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); -} + + int ajoutPointsCarte(int tNoCarte[], int tPointsCarte[], int tCarteActive[], int nbelem) { diff --git a/SAE.h b/SAE.h index 76bb56a..70ded68 100644 --- a/SAE.h +++ b/SAE.h @@ -1,11 +1,13 @@ #include #include -int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int tmax); +int OuvertureMembres(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tmax); +int OuvertureActivitesJour(int tNbActivitesJour[], int tDate[], int tmax); void testOuverture(void); +/* int Sauvegarde(); void testSauvegarde(void); -/* + int pointsBonus(); int CreationAdherent(); int FrequenceCentre(); diff --git a/exe b/exe index 5d118ea19c6fe8f4e242c1baef76390bf552a187..2e56178690e22cb21a676c249274dfa185731b5b 100755 GIT binary patch delta 3607 zcmaJ^eQXow8Gr8_J9hYp?UFd5u-KsmvJE>nNrM5$Hi_Fe42DyZ5+*f?3C`jz6EcltJbVylBwFs5wvp|R1ON+b2`ORdM$(>*lWyYi)35Q1nl-qv#n{Vlo8c|H1{=2Q{L7^x-C?rP4 zT9jr*G0l?Qj8!)vi6dm3`KiTh5si;yi>O8|q>BCRnt4m;@QFWtUfR>C?RET4d;MpB zcBx2)eX3*yxH0e*%a02|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Nov 2022 21:14:11 +0100 Subject: [PATCH 2/6] Ajout --- SAE.c | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/SAE.c b/SAE.c index c4d3292..1ccbecb 100644 --- a/SAE.c +++ b/SAE.c @@ -6,7 +6,7 @@ int Ouverture(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[] pasMembres = OuvertureMembres(tNoCarte, tage, tPointsCarte, tCarteActive, tmax); pasAct = OuvertureActivitesJour(tNbActivitesJour, tDate, tmax); *pasAct = pasAct; - return pasMembres + return pasMembres; } int OuvertureMembres(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tmax) @@ -69,6 +69,23 @@ int OuvertureActivitesJour(int tNbActivitesJour[], int tDate[], int tmax) } int choixMenu(void) +{ + int choix; + printf("\t Gestion des matières\n"); + printf("1.\tAffichage\n"); + printf("2.\tAjouter un client\n"); + printf("3.\tModifier l'âge d'un client\n"); + printf("4.\tSuppression d'un client\n"); + printf("5.\tAjout de points sur une carte\n"); + printf("6.\tModification de l'état de la carte\n"); + printf("7.\tCréditer une activité à une carte\n"); + printf("8.\tQuitter\n"); + printf("\noption choisie :\n"); + scanf("%d", &choix); + return choix; +} + +int MenuAffichage(void) { int choix; printf("\t Gestion des matières\n"); @@ -101,7 +118,7 @@ void gestionMatieres(void) { if(choix == 1) { - affichage(tMatieres, tCoeff, nbMatieres); + MenuAffichage(tMatieres, tCoeff, nbMatieres); } if(choix == 2) { From 43a8a37d1fd92680ba8d63a2de6e1a25706bfa6f Mon Sep 17 00:00:00 2001 From: IA Date: Wed, 9 Nov 2022 21:27:49 +0100 Subject: [PATCH 3/6] =?UTF-8?q?Ajout=20d'un=20sous=20menu=20et=20des=20fon?= =?UTF-8?q?ction=20assign=C3=A9es?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- SAE.c | 55 ++++++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 40 insertions(+), 15 deletions(-) diff --git a/SAE.c b/SAE.c index 1ccbecb..3f9a180 100644 --- a/SAE.c +++ b/SAE.c @@ -73,9 +73,9 @@ int choixMenu(void) int choix; printf("\t Gestion des matières\n"); printf("1.\tAffichage\n"); - printf("2.\tAjouter un client\n"); - printf("3.\tModifier l'âge d'un client\n"); - printf("4.\tSuppression d'un client\n"); + printf("2.\tAjouter un adhérent\n"); + printf("3.\tModifier l'âge d'un adhérent\n"); + printf("4.\tSuppression d'un adhérent\n"); printf("5.\tAjout de points sur une carte\n"); printf("6.\tModification de l'état de la carte\n"); printf("7.\tCréditer une activité à une carte\n"); @@ -85,18 +85,16 @@ int choixMenu(void) return choix; } -int MenuAffichage(void) +int choixMenuAffichage(void) { int choix; printf("\t Gestion des matières\n"); - printf("1.\taffichage\n"); - printf("2.\tAjouter un client\n"); - printf("3.\tModifier l'âge d'un client\n"); - printf("4.\tsuppression d'un client\n"); - printf("5.\tAjout de points sur une carte\n"); - printf("6.\tModification de l'état de la carte\n"); - printf("7.\tCréditer une activité à une carte\n"); - printf("8.\tquitter\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("5.\tAffichage du nombre total d'adhérents\n"); + printf("6.\tquitter\n"); printf("\noption choisie :\n"); scanf("%d", &choix); return choix; @@ -108,7 +106,7 @@ void gestionMatieres(void) int tDate[20] = {0}, tNbActivitesJour[20] = {0}; int tmax = 20, nbelem, choix, pasAct; nbelem = Ouverture(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, tmax, &pasAct); - if(nbMatieres < 0) + if(nbelem < 0) { printf("Erreur d'ouverture du fichier ou tableau plein !!!\n"); return ; @@ -118,7 +116,35 @@ void gestionMatieres(void) { if(choix == 1) { - MenuAffichage(tMatieres, tCoeff, nbMatieres); + choix = choixMenuAffichage(); + while(choix != 9) + { + if(choix == 1) + { + + } + if(choix == 2) + { + modificationCoefficient(tMatieres, tCoeff, nbMatieres); + } + if(choix == 3) + { + nbMatieres = insertionNewMatiere(tMatieres, tCoeff, nbMatieres, max); + } + if(choix == 4) + { + nbMatieres = suppressionMatiere(tMatieres, tCoeff, nbMatieres); + } + if(choix == 5) + { + MoyenneNotesMatiere(tMatieres, tNotes, tNbNotes, nbMatieres); + } + if(choix == 6) + { + MoyenneEtudiant(tCoeff, tMatieres, tNotes, tNbNotes, nbMatieres); + } + choix = choixMenu(); + } } if(choix == 2) { @@ -143,7 +169,6 @@ void gestionMatieres(void) choix = choixMenu(); } sauvegarde(tMatieres, tCoeff, nbMatieres); - fclose(flot); exit(1); } /* From 754582a906744b3bf2c8738d134d1cccc6463373 Mon Sep 17 00:00:00 2001 From: IA Date: Wed, 9 Nov 2022 21:41:43 +0100 Subject: [PATCH 4/6] nn --- SAE.c | 55 ++++++++++++++++++++++++++++++++----------------------- 1 file changed, 32 insertions(+), 23 deletions(-) diff --git a/SAE.c b/SAE.c index 3f9a180..10004ba 100644 --- a/SAE.c +++ b/SAE.c @@ -99,7 +99,22 @@ int choixMenuAffichage(void) scanf("%d", &choix); return choix; } +void Affichage1Adherent() +{ + +} +void AffichageTousAdherents() +{ + +} +void AffichageNbEntreesJour() +{ +} +void AffichageNbEntreesTousJours() +{ + +} void gestionMatieres(void) { int tNoCarte[20] = {0}, tage[20] = {0}, tPointsCarte[20] = {0}, tCarteActive[20] = {0}; @@ -112,12 +127,12 @@ void gestionMatieres(void) return ; } choix = choixMenu(); - while(choix != 9) + while(choix != 8) { if(choix == 1) { choix = choixMenuAffichage(); - while(choix != 9) + while(choix != 6) { if(choix == 1) { @@ -125,53 +140,49 @@ void gestionMatieres(void) } if(choix == 2) { - modificationCoefficient(tMatieres, tCoeff, nbMatieres); + } if(choix == 3) { - nbMatieres = insertionNewMatiere(tMatieres, tCoeff, nbMatieres, max); + } if(choix == 4) { - nbMatieres = suppressionMatiere(tMatieres, tCoeff, nbMatieres); + } if(choix == 5) { - MoyenneNotesMatiere(tMatieres, tNotes, tNbNotes, nbMatieres); - } - if(choix == 6) - { - MoyenneEtudiant(tCoeff, tMatieres, tNotes, tNbNotes, nbMatieres); + } - choix = choixMenu(); + choix = choixMenuAffichage(); } } if(choix == 2) { - modificationCoefficient(tMatieres, tCoeff, nbMatieres); + } if(choix == 3) { - nbMatieres = insertionNewMatiere(tMatieres, tCoeff, nbMatieres, max); + } if(choix == 4) { - nbMatieres = suppressionMatiere(tMatieres, tCoeff, nbMatieres); + } if(choix == 5) { - MoyenneNotesMatiere(tMatieres, tNotes, tNbNotes, nbMatieres); + } if(choix == 6) { - MoyenneEtudiant(tCoeff, tMatieres, tNotes, tNbNotes, nbMatieres); + } choix = choixMenu(); } - sauvegarde(tMatieres, tCoeff, nbMatieres); + sauvegarde(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, nbelem); exit(1); } -/* + int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tNbActivitesJour[], int tDate[], int nbelem) { int i, j; @@ -200,6 +211,9 @@ int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[ fclose(flot); } +/* + + void ajouterPoints(int tNumCarte[], int tPoints[], int tailleLog) { @@ -344,16 +358,11 @@ int CreationAdherents(int tNoCarte[], int tage[], int tPointsCarte[], int tCarte nbelem = nbelem + 1; } -/* void pointsBonus() { } - - - - int CreationAdherents(int tAdherents[], nbClients) { int NoCarte, nom, prenom, age, pointsCarte, CarteActive, nbActivitéesJour; From 74d638b0201c8b5fcbaa4545707964479a2f5caf Mon Sep 17 00:00:00 2001 From: "antoine.perederii" Date: Wed, 9 Nov 2022 22:24:41 +0100 Subject: [PATCH 5/6] modification et mise en lien du travail de kyllian avec le reste --- SAE.c | 57 ++++++--------------------------------------------------- SAE.h | 32 +++++++++++++++++++++++--------- 2 files changed, 29 insertions(+), 60 deletions(-) diff --git a/SAE.c b/SAE.c index cdb6cb1..fe96184 100644 --- a/SAE.c +++ b/SAE.c @@ -115,7 +115,11 @@ void AffichageNbEntreesTousJours() { } -void gestionMatieres(void) +void AffichageNbAdherents() +{ + +} +void gestionMenus(void) { int tNoCarte[20] = {0}, tage[20] = {0}, tPointsCarte[20] = {0}, tCarteActive[20] = {0}; int tDate[20] = {0}, tNbActivitesJour[20] = {0}; @@ -179,7 +183,7 @@ void gestionMatieres(void) } choix = choixMenu(); } - sauvegarde(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, nbelem); + Sauvegarde(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, nbelem); exit(1); } @@ -276,55 +280,6 @@ int recherche(int tab[], int tailleLog, int valeur, int *trouve) return tailleLog; } -void ajouterPoints(int tNumCarte[], int tPoints[], int tailleLog) -{ - - 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"); - return; - } - else - { - modifierPoints(tNumCarte, tPoints, tailleLog, numCarte, nbPoints); - return; - } -} - -int modifierPoints(int tNumCarte[], int tPoints[], int tailleLog, int numCarte, int nbPoints) -{ - int index, trouve; - - index = recherche(tNumCarte, tailleLog, numCarte, &trouve); - - if (trouve == 0) - { - printf("Numéro de carte non trouvé. Annulation de l'opétation."); - return 0; - } - else - { - tPoints[index] += nbPoints; - return 1; - } -} - void modifierAge(int tNumCarte[], int tAge[], int tailleLog) { int numCarte, age, index, trouve; diff --git a/SAE.h b/SAE.h index 4efbdda..086eccb 100644 --- a/SAE.h +++ b/SAE.h @@ -1,19 +1,33 @@ #include #include +/* Fonctions Ouverture des fichiers textes */ int OuvertureMembres(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], int tmax); int OuvertureActivitesJour(int tNbActivitesJour[], int tDate[], int tmax); -void testOuverture(void); -/* -int Sauvegarde(); -void testSauvegarde(void); +void testOuverture(); -int pointsBonus(); -int CreationAdherent(); -int FrequenceCentre(); -*/ +/* Fonctions des menus */ +void choixMenu(); +void choixMenuAffichage(); +/* Fonctions d'affichage */ +void Affichage1Adherent(); +void AffichageTousAdherents(); +void AffichageNbEntreesJour(); +void AffichageNbEntreesTousJours(); +void AffichageNbAdherents(); + +/* Fonction global */ +void gestionMenus(void); + +/* Fonction Sauvegarde */ +int Sauvegarde(int tNoCarte[], int tage[], int tPointsCarte[], int tCarteActive[], inttNbActivitesJour[], int tDate[], int nbelem); + +/* Fonctions de gestion des adherents */ + + +/* 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 tPoints[], int tailleLog, int nbPoints); void modifierAge(int tNumCarte[], int tAge[], int tailleLog); \ No newline at end of file From eace96ceec6e12a03ed79765c6dc2f38affbac6c Mon Sep 17 00:00:00 2001 From: "antoine.perederii" Date: Thu, 10 Nov 2022 00:36:18 +0100 Subject: [PATCH 6/6] 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}?$r?TtEBvLYS+8yU2kf{`_${}yibjmc#D4G zeeT`(Oc*$z4V2~vn`Jw!zjy81V2Q-F4c@M`y9o8BUX4%lrq{lRN_H{2lx@MsPbNQy zdeL^)V>t9lFdLwQfvfSRI zys5tIJT#Z`oC6yop5y5TP=7{@yD@%Hs7w{7J?Eb3)%G{TKI|s?VgESn_td65Pxg7v z!3qMl{Fylf);Hf4d>Gl7dV3=xm|6ZUvX<&QO2)GfLT{)C7~Hwu^JL;G82kbm%z!~^7W)e91;u-K39ZP%8$R6b}`XwVfmT_D%PLE~uNXB5Q_&qx?f?HK)2cAEd%XN9q z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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