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