|
|
@ -1,6 +1,6 @@
|
|
|
|
/**
|
|
|
|
/**
|
|
|
|
* @file responsable.c
|
|
|
|
* @file responsable.c
|
|
|
|
* @author Kyllian Chabanon
|
|
|
|
* @author Kyllian Chabanon - Antoine Perederii
|
|
|
|
* @brief Fichier contenant les fonctions du responsable de département
|
|
|
|
* @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
|
|
|
|
* @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 tiut Tableau des IUT
|
|
|
|
* @param nbVilles Nombre des IUT
|
|
|
|
* @param nbVilles Nombre des IUT
|
|
|
|
* @param respVille Ville du responsable
|
|
|
|
* @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
|
|
|
|
* @brief Charge le tableau des candidats ayant candidatés dans le département du responsable
|
|
|
|
*
|
|
|
|
*
|
|
|
|
|
|
|
|
* @author Kyllian Chabanon
|
|
|
|
* @param tetud Tableau des candidats
|
|
|
|
* @param tetud Tableau des candidats
|
|
|
|
* @param nbCand Nombre de candidats
|
|
|
|
* @param nbCand Nombre de candidats
|
|
|
|
* @param respVille Ville du responsable
|
|
|
|
* @param respVille Ville du responsable
|
|
|
@ -62,6 +64,19 @@ int chargementRespDept(Etudiant *tetud[], int nbCand, char respVille[], char res
|
|
|
|
return nb;
|
|
|
|
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
|
|
|
|
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;
|
|
|
|
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))
|
|
|
|
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;
|
|
|
|
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))
|
|
|
|
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;
|
|
|
|
tetud[i]->lChoix->choix.decisionAdmission = 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
printf("test 333333 \n");
|
|
|
|
|
|
|
|
tetud[i]->lChoix->choix.decisionAdmission = -1;
|
|
|
|
tetud[i]->lChoix->choix.decisionAdmission = -1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return **tetud;
|
|
|
|
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;
|
|
|
|
int i;
|
|
|
|
for (i = 0; i < nbCandidats; i++)
|
|
|
|
for (i = 0; i < nbCandidats; i++)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (tetud[i]->lChoix->choix.decisionAdmission == 1)
|
|
|
|
if (tetud[i]->lChoix->choix.decisionAdmission == 1)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tetudAdmis[nbEtudAdmis] = tetud[i];
|
|
|
|
tetudAdmis[*nbEtudAdmis] = tetud[i];
|
|
|
|
nbEtudAdmis++;
|
|
|
|
*nbEtudAdmis++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if (tetud[i]->lChoix->choix.decisionAdmission == 2)
|
|
|
|
else if (tetud[i]->lChoix->choix.decisionAdmission == 2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tetudAttente[nbEtudAttente] = tetud[i];
|
|
|
|
tetudAttente[*nbEtudAttente] = tetud[i];
|
|
|
|
nbEtudAttente++;
|
|
|
|
*nbEtudAttente++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
afficherCandidats(tetudAdmis, nbEtudAdmis);
|
|
|
|
afficherCandidats(tetudAdmis, *nbEtudAdmis);
|
|
|
|
printf("------------------------\n");
|
|
|
|
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 nbCandidatsAdmis(Etudiant *tetud[], int nbCandidats)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int nbAdmis = 0;
|
|
|
|
int nbAdmis = 0;
|
|
|
@ -134,6 +164,14 @@ int nbCandidatsAdmis(Etudiant *tetud[], int nbCandidats)
|
|
|
|
return nbAdmis;
|
|
|
|
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 nbCandidatsRefuses(Etudiant *tetud[], int nbCandidats)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int nbRefuses = 0;
|
|
|
|
int nbRefuses = 0;
|
|
|
@ -147,6 +185,14 @@ int nbCandidatsRefuses(Etudiant *tetud[], int nbCandidats)
|
|
|
|
return nbRefuses;
|
|
|
|
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 nbCandidatsAttente(Etudiant *tetud[], int nbCandidats)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int nbAttente = 0;
|
|
|
|
int nbAttente = 0;
|
|
|
@ -160,11 +206,18 @@ int nbCandidatsAttente(Etudiant *tetud[], int nbCandidats)
|
|
|
|
return nbAttente;
|
|
|
|
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[])
|
|
|
|
float modifNoteMin(float noteMin[])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
for (int i = 0; i < 5; i++)
|
|
|
|
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", ¬eMin[i]);
|
|
|
|
scanf("%f", ¬eMin[i]);
|
|
|
|
while (noteMin[i] < 0 || noteMin[i] > 20)
|
|
|
|
while (noteMin[i] < 0 || noteMin[i] > 20)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -179,6 +232,15 @@ float modifNoteMin(float noteMin[])
|
|
|
|
return *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])
|
|
|
|
void modificationNbPDeptResp(VilleIUT *tiut[], int nbIUT, char respVille[30], char respDept[30])
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int posIUT, posDept, nbPlaces;
|
|
|
|
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));
|
|
|
|
printf("Le nombre de places est bien passé à %d.\n", getNbP(tiut[posIUT]->ldept, posDept));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int modifNbPlaces(int nbPlaces)
|
|
|
|
/**
|
|
|
|
{
|
|
|
|
* @brief Trie le tableau des candidats par moyenne
|
|
|
|
printf("Entrez le nombre de places disponibles : ");
|
|
|
|
*
|
|
|
|
scanf("%d", &nbPlaces);
|
|
|
|
* @author Kyllian Chabanon
|
|
|
|
return nbPlaces;
|
|
|
|
* @param tetudResp Tableau des candidats
|
|
|
|
}
|
|
|
|
* @param nbCandResp Nombre de candidats
|
|
|
|
|
|
|
|
*/
|
|
|
|
void triNote(Etudiant *tetudResp[], int nbCandResp)
|
|
|
|
void triNote(Etudiant *tetudResp[], int nbCandResp)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int min;
|
|
|
|
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)
|
|
|
|
void echanger(Etudiant *tetudResp[], int i, int j)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
Etudiant *aux;
|
|
|
|
Etudiant *aux;
|
|
|
@ -227,6 +297,14 @@ void echanger(Etudiant *tetudResp[], int i, int j)
|
|
|
|
tetudResp[j] = aux;
|
|
|
|
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 plusPetit(Etudiant *tetudResp[], int nbCandResp)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int min = 0;
|
|
|
|
int min = 0;
|
|
|
|