modification et mise en lien du travail de kyllian avec le reste

master
antoine.perederii 2 years ago
parent b5ff33c384
commit 74d638b020

57
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 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};
@ -179,7 +183,7 @@ void gestionMatieres(void)
} }
choix = choixMenu(); choix = choixMenu();
} }
sauvegarde(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, nbelem); Sauvegarde(tNoCarte, tage, tPointsCarte, tCarteActive, tNbActivitesJour, tDate, nbelem);
exit(1); exit(1);
} }
@ -276,55 +280,6 @@ int recherche(int tab[], int tailleLog, int valeur, int *trouve)
return tailleLog; 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) void modifierAge(int tNumCarte[], int tAge[], int tailleLog)
{ {
int numCarte, age, index, trouve; int numCarte, age, index, trouve;

32
SAE.h

@ -1,19 +1,33 @@
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
/* Fonctions Ouverture des fichiers textes */
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); void testOuverture();
/*
int Sauvegarde();
void testSauvegarde(void);
int pointsBonus(); /* Fonctions des menus */
int CreationAdherent(); void choixMenu();
int FrequenceCentre(); 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 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 tPoints[], int tailleLog, int nbPoints);
void modifierAge(int tNumCarte[], int tAge[], int tailleLog); void modifierAge(int tNumCarte[], int tAge[], int tailleLog);
Loading…
Cancel
Save