master
Kyllian Chabanon 2 years ago
parent a9a17c39f1
commit 38fdbb6645

@ -11,8 +11,8 @@ void menu(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats, boo
void menuAdministrateur(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats, bool *phaseCandidatures, bool *phaseTraitement);
void menuUtilisateur(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats);
void menuCandidat(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats);
void menuResponsable(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int *nbIUT, Etudiant *tetudAdmis[], int nbEtudAdmis, Etudiant *tetudAttente[], int nbEtudAttente);
void menuAffichage(Etudiant *tetudResp[], int nbCandidatsDept);
void menuResponsable(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int *nbIUT, Etudiant *tetudAdmis[], int *nbEtudAdmis, Etudiant *tetudAttente[], int *nbEtudAttente);
void menuAffichage(Etudiant *tetudResp[], int nbCandidatsDept, int *nbCandidatsAdmis, int *nbCandidatsAttente);
void menuPostCandidat(Etudiant *tetud[], int *nbCandidats);
@ -52,12 +52,11 @@ void afficherCandidatsAttente(Etudiant *tetud[], int nbCandidats);
Etudiant moyenneCandidat(Etudiant mEtudiant);
Etudiant *moyenneCandidats(Etudiant *tetud[], int nbCandiats);
Etudiant modifStatueCandidat(Etudiant *tetud[], int nbCandidats, float noteMin[], VilleIUT *tiut[], int nbIUT, char respVille[30], char respDept[30]);
int statueCandidat(Etudiant *tetud[], int nbCandidats, Etudiant *tetudAdmis[], Etudiant *tetudAttente[], int nbEtudAdmis, int nbEtudAttente);
void statueCandidat(Etudiant *tetud[], int nbCandidats, Etudiant *tetudAdmis[], Etudiant *tetudAttente[], int *nbEtudAdmis, int *nbEtudAttente);
int nbCandidatsAdmis(Etudiant *tetud[], int nbCandidats);
int nbCandidatsRefuses(Etudiant *tetud[], int nbCandidats);
int nbCandidatsAttente(Etudiant *tetud[], int nbCandidats);
float modifNoteMin(float noteMin[]);
int modifNbPlaces(int nbPlaces);
void ajouterCandidature(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int nbVillesIUT);
void supprimerCandidature(Etudiant *tetud[], int nbCandidats);
int inscription(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int nbVillesIUT);

@ -76,7 +76,7 @@ void menu(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats, boo
menuCandidat(tiut, nbIUT, tetud, nbCandidats);
break;
case 4:
menuResponsable(tetud, *nbCandidats, tiut, nbIUT, tetudAdmis, *nbEtudAdmis, tetudAttente, *nbEtudAttente);
menuResponsable(tetud, *nbCandidats, tiut, nbIUT, tetudAdmis, nbEtudAdmis, tetudAttente, nbEtudAttente);
break;
case 5:
menuPostCandidat(tetud, nbCandidats);
@ -264,7 +264,7 @@ void menuCandidat(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandid
* @param tetudAttente Tableau des étudiants en file d'attente
* @param nbEtudAttente Nombre d'étudiants en file d'attente
*/
void menuResponsable(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int *nbIUT, Etudiant *tetudAdmis[], int nbEtudAdmis, Etudiant *tetudAttente[], int nbEtudAttente)
void menuResponsable(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int *nbIUT, Etudiant *tetudAdmis[], int *nbEtudAdmis, Etudiant *tetudAttente[], int *nbEtudAttente)
{
int choix;
bool c = false;
@ -288,7 +288,7 @@ void menuResponsable(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int *
switch (choix)
{
case 1:
menuAffichage(tetudResp, nbCandidatsDept);
menuAffichage(tetudResp, nbCandidatsDept, nbEtudAdmis, nbEtudAttente);
break;
case 2:
modificationNbPDeptResp(tiut, *nbIUT, respVille, respDept);
@ -297,9 +297,9 @@ void menuResponsable(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int *
*noteMin = modifNoteMin(noteMin);
break;
case 4:
modifStatueCandidat(tetudResp, nbCandidatsDept, noteMin, tiut, *nbIUT, respVille, respDept); //! Les valeurs ne se return pas
modifStatueCandidat(tetudResp, nbCandidatsDept, noteMin, tiut, *nbIUT, respVille, respDept);
statueCandidat(tetudResp, nbCandidatsDept, tetudAdmis, tetudAttente, nbEtudAdmis, nbEtudAttente);
afficherCandidats(tetudAdmis, nbEtudAdmis);
afficherCandidats(tetudAdmis, *nbEtudAdmis);
break;
case 9:
c = true;
@ -324,11 +324,11 @@ void menuResponsable(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int *
* @param tetudAttente Tableau des étudiants en file d'attente
* @param nbEtudAttente Nombre d'étudiants en file d'attente
*/
void menuAffichage(Etudiant *tetudResp[], int nbCandidatsDept)
void menuAffichage(Etudiant *tetudResp[], int nbEtudDept, int *nbEtudAdmis, int *nbEtudAttente)
{
int choix;
bool c = false;
int nbCandidatsDeptAdmis = 0, nbCandidatsDeptAttente = 0, nbCandidatsDeptRefuse = 0;
int nbEtudRefuses;
while (c == false)
{
printf("\n\nMenu des Affichages Responsable de Departement : Que voulez-vous faire ?\n");
@ -343,26 +343,24 @@ void menuAffichage(Etudiant *tetudResp[], int nbCandidatsDept)
switch (choix)
{
case 1:
afficherCandidats(tetudResp, nbCandidatsDept);
printf("Il y a %d candidats dans votre departement.\n", nbCandidatsDept);
afficherCandidats(tetudResp, nbEtudDept);
printf("Il y a %d candidats dans votre departement.\n", nbEtudDept);
break;
case 2:
nbCandidatsDeptAdmis = nbCandidatsAdmis(tetudResp, nbCandidatsDept);
afficherCandidatsAdmis(tetudResp, nbCandidatsDept);
printf("Il y a %d candidats admis dans votre departement.\n", nbCandidatsDeptAdmis);
afficherCandidatsAdmis(tetudResp, nbEtudDept);
printf("Il y a %d candidats admis dans votre departement.\n", *nbEtudAdmis);
break;
case 3:
nbCandidatsDeptRefuse = nbCandidatsRefuses(tetudResp, nbCandidatsDept);
afficherCandidatsRefuses(tetudResp, nbCandidatsDept);
printf("Il y a %d candidats refusés dans votre departement.\n", nbCandidatsDeptRefuse);
nbEtudRefuses = nbCandidatsRefuses(tetudResp, nbEtudDept);
afficherCandidatsRefuses(tetudResp, nbEtudDept);
printf("Il y a %d candidats refusés dans votre departement.\n", nbEtudRefuses);
break;
case 4:
nbCandidatsDeptAttente = nbCandidatsAttente(tetudResp, nbCandidatsDept);
afficherCandidatsAttente(tetudResp, nbCandidatsDept);
printf("Il y a %d candidats en attente dans votre departement.\n", nbCandidatsDeptAttente);
afficherCandidatsAttente(tetudResp, nbEtudDept);
printf("Il y a %d candidats en attente dans votre departement.\n", *nbEtudAttente);
break;
case 5:
afficherCandidat(tetudResp, nbCandidatsDept);
afficherCandidat(tetudResp, nbEtudDept);
break;
case 9:
c = true;

@ -35,6 +35,7 @@ int rechercheVille(VilleIUT *tiut[], int nb, char val[], bool *trouve)
/**
* @brief Retourne la position du candidat recherché et un booléen qui prend la valeur true si l'élément a été trouvé et false sinon
*
* @author Antoine Perederii
* @param tetud Tableau des candidats
* @param nbCandidats Nombre de candidats
* @param numRecherche Numéro du candidat à rechercher

@ -1,6 +1,6 @@
/**
* @file responsable.c
* @author Kyllian Chabanon
* @author Kyllian Chabanon - Antoine Perederii
* @brief Fichier contenant les fonctions du responsable de département
*
*/
@ -10,6 +10,7 @@
/**
* @brief Renvoie par adresse le département et la ville du département duquel le responsable s'occupe
*
* @author Kyllian Chabanon
* @param tiut Tableau des IUT
* @param nbVilles Nombre des IUT
* @param respVille Ville du responsable
@ -38,6 +39,7 @@ void deptResp(VilleIUT *tiut[], int nbVilles, char respVille[], char respIUT[])
/**
* @brief Charge le tableau des candidats ayant candidatés dans le département du responsable
*
* @author Kyllian Chabanon
* @param tetud Tableau des candidats
* @param nbCand Nombre de candidats
* @param respVille Ville du responsable
@ -62,6 +64,19 @@ int chargementRespDept(Etudiant *tetud[], int nbCand, char respVille[], char res
return nb;
}
/**
* @brief Modification du statut d'un candidat
*
* @author Antoine Perederii
* @param tetud Tableau des candidats
* @param nbCandidats Nombre de candidats
* @param noteMin Tableau de notes minimales
* @param tiut Tableau d'IUT
* @param nbIUT Nombre d'IUT
* @param respVille Ville du responsable
* @param respDept Département du responsable
* @return Etudiant
*/
Etudiant modifStatueCandidat(Etudiant *tetud[], int nbCandidats, float noteMin[], VilleIUT *tiut[], int nbIUT, char respVille[30], char respDept[30]) //! tableau des admis + compteur admis
{
int posIUT, posDept, nbPlaces;
@ -82,45 +97,60 @@ Etudiant modifStatueCandidat(Etudiant *tetud[], int nbCandidats, float noteMin[]
{
if (tetud[i]->tabNotes[maths] >= noteMin[maths] && tetud[i]->tabNotes[francais] >= noteMin[francais] && tetud[i]->tabNotes[anglais] >= noteMin[anglais] && tetud[i]->tabNotes[spe] >= noteMin[spe] && tetud[i]->tabNotes[moy] >= noteMin[moy] && nbCandidatsAdmis(tetud, nbCandidats) <= getNbP(tiut[posIUT]->ldept, posDept))
{
printf("test 111111 \n");
printf("nbCandidatsAdmis(tetud, nbCandidats) = %d\n", nbCandidatsAdmis(tetud, nbCandidats));
tetud[i]->lChoix->choix.decisionAdmission = 1;
}
else if (tetud[i]->tabNotes[maths] >= noteMin[maths] && tetud[i]->tabNotes[francais] >= noteMin[francais] && tetud[i]->tabNotes[anglais] >= noteMin[anglais] && tetud[i]->tabNotes[spe] >= noteMin[spe] && tetud[i]->tabNotes[moy] >= noteMin[moy] && nbCandidatsAdmis(tetud, nbCandidats) > getNbP(tiut[posIUT]->ldept, posDept))
{
printf("test 222222 \n");
tetud[i]->lChoix->choix.decisionAdmission = 2;
}
else
{
printf("test 333333 \n");
tetud[i]->lChoix->choix.decisionAdmission = -1;
}
}
return **tetud;
}
int statueCandidat(Etudiant *tetud[], int nbCandidats, Etudiant *tetudAdmis[], Etudiant *tetudAttente[], int nbEtudAdmis, int nbEtudAttente)
/**
* @brief Ajoute les candidats dans les tableaux des candidats admis et en attente
*
* @author Kyllian Chabanon - Antoine Perederii
* @param tetud Tableau des candidats
* @param nbCandidats Nombre de candidats
* @param tetudAdmis Tableau des candidats admis
* @param tetudAttente Tableau des candidats en attente
* @param nbEtudAdmis Nombre d'étudiants admis
* @param nbEtudAttente Nombre d'étudiants en attente
*/
void statueCandidat(Etudiant *tetud[], int nbCandidats, Etudiant *tetudAdmis[], Etudiant *tetudAttente[], int *nbEtudAdmis, int *nbEtudAttente)
{
int i;
for (i = 0; i < nbCandidats; i++)
{
if (tetud[i]->lChoix->choix.decisionAdmission == 1)
{
tetudAdmis[nbEtudAdmis] = tetud[i];
nbEtudAdmis++;
tetudAdmis[*nbEtudAdmis] = tetud[i];
*nbEtudAdmis++;
}
else if (tetud[i]->lChoix->choix.decisionAdmission == 2)
{
tetudAttente[nbEtudAttente] = tetud[i];
nbEtudAttente++;
tetudAttente[*nbEtudAttente] = tetud[i];
*nbEtudAttente++;
}
}
afficherCandidats(tetudAdmis, nbEtudAdmis);
afficherCandidats(tetudAdmis, *nbEtudAdmis);
printf("------------------------\n");
afficherCandidats(tetudAttente, nbEtudAttente);
afficherCandidats(tetudAttente, *nbEtudAttente);
}
/**
* @brief Retourne le nombre de candidats admis
*
* @author Antoine Perederii
* @param tetud Tableau de candidats
* @param nbCandidats Nombre de candidats
* @return int
*/
int nbCandidatsAdmis(Etudiant *tetud[], int nbCandidats)
{
int nbAdmis = 0;
@ -134,6 +164,14 @@ int nbCandidatsAdmis(Etudiant *tetud[], int nbCandidats)
return nbAdmis;
}
/**
* @brief Retourne le nombre de candidats refusés
*
* @author Antoine Perederii
* @param tetud Tableau de candidats
* @param nbCandidats Nombre de candidats
* @return int
*/
int nbCandidatsRefuses(Etudiant *tetud[], int nbCandidats)
{
int nbRefuses = 0;
@ -147,6 +185,14 @@ int nbCandidatsRefuses(Etudiant *tetud[], int nbCandidats)
return nbRefuses;
}
/**
* @brief Retourne le nombre de candidats en attente
*
* @author Antoine Perederii
* @param tetud Tableau de candidats
* @param nbCandidats Nombre de candidats
* @return int
*/
int nbCandidatsAttente(Etudiant *tetud[], int nbCandidats)
{
int nbAttente = 0;
@ -160,11 +206,18 @@ int nbCandidatsAttente(Etudiant *tetud[], int nbCandidats)
return nbAttente;
}
/**
* @brief Retourne les notes minimales
*
* @author Antoine Perederii
* @param noteMin Tableau de nombre flottants contenant les notes minimales
* @return float
*/
float modifNoteMin(float noteMin[])
{
for (int i = 0; i < 5; i++)
{
printf("Entrez la note minimale pour la matiere %d (0/20, -1 pour sortir) : ", i + 1); // afficher le nom de la matiere du enum
printf("Entrez la note minimale pour la matiere %d (0/20, -1 pour sortir) : ", i + 1);
scanf("%f", &noteMin[i]);
while (noteMin[i] < 0 || noteMin[i] > 20)
{
@ -179,6 +232,15 @@ float modifNoteMin(float noteMin[])
return *noteMin;
}
/**
* @brief Modifie le nombre de places du département
*
* @author Kyllian Chabanon - Antoine Perederii
* @param tiut Tableau des IUT
* @param nbIUT Nombre d'IUT
* @param respVille Ville du responsable
* @param respDept Département du responsable
*/
void modificationNbPDeptResp(VilleIUT *tiut[], int nbIUT, char respVille[30], char respDept[30])
{
int posIUT, posDept, nbPlaces;
@ -201,13 +263,13 @@ void modificationNbPDeptResp(VilleIUT *tiut[], int nbIUT, char respVille[30], ch
printf("Le nombre de places est bien passé à %d.\n", getNbP(tiut[posIUT]->ldept, posDept));
}
int modifNbPlaces(int nbPlaces)
{
printf("Entrez le nombre de places disponibles : ");
scanf("%d", &nbPlaces);
return nbPlaces;
}
/**
* @brief Trie le tableau des candidats par moyenne
*
* @author Kyllian Chabanon
* @param tetudResp Tableau des candidats
* @param nbCandResp Nombre de candidats
*/
void triNote(Etudiant *tetudResp[], int nbCandResp)
{
int min;
@ -219,6 +281,14 @@ void triNote(Etudiant *tetudResp[], int nbCandResp)
}
}
/**
* @brief Permute deux cases d'un tableau
*
* @author Kyllian Chabanon
* @param tetudResp Tableau des candidats
* @param i Première case
* @param j Seconde case
*/
void echanger(Etudiant *tetudResp[], int i, int j)
{
Etudiant *aux;
@ -227,6 +297,14 @@ void echanger(Etudiant *tetudResp[], int i, int j)
tetudResp[j] = aux;
}
/**
* @brief Retourne l'emplacement du plus petit élément dans un tableau
*
* @author Kyllian Chabanon
* @param tetudResp Tableau des candidats
* @param nbCandResp Nombre de candidats
* @return int
*/
int plusPetit(Etudiant *tetudResp[], int nbCandResp)
{
int min = 0;

@ -121,6 +121,12 @@ void sauvegardeAttente(Etudiant *tetudAttente[], int nbEtudAttente)
sauvegarderCandidats(tetudAttente, nbEtudAttente, "candidatsAttente.txt");
}
/**
* @brief Libère l'espace alloué au tableau des candidats
*
* @param tetud Tableau des candidats
* @param nbCandidats Nombre de candidats
*/
void libererEspaceCandidats(Etudiant *tetud[], int nbCandidats)
{
for (int i = 0; i < nbCandidats; i++)
@ -129,6 +135,12 @@ void libererEspaceCandidats(Etudiant *tetud[], int nbCandidats)
}
}
/**
* @brief Libère l'espace alloué au tableau des IUT
*
* @param tiut Tableau des IUT
* @param nbIUT Nombre d'IUT
*/
void libererEspaceIUT(VilleIUT *tiut[], int nbIUT)
{
for (int i = 0; i < nbIUT; i++)

Loading…
Cancel
Save