|
|
|
@ -24,7 +24,7 @@ void afficherEtudiant(Etudiant mEtudiant)
|
|
|
|
|
{
|
|
|
|
|
// TODO : Changer l'affichage
|
|
|
|
|
int i;
|
|
|
|
|
printf("%d\n%s\n%s\n%.2f\t%.2f\t%.2f\t%.2f\n%d\n", mEtudiant.num, mEtudiant.nom, mEtudiant.prenom, mEtudiant.tabMatiere[0], mEtudiant.tabMatiere[1], mEtudiant.tabMatiere[2], mEtudiant.tabMatiere[3], mEtudiant.nbChoix);
|
|
|
|
|
printf("%d\n%s\n%s\n%.2f\t%.2f\t%.2f\t%.2f\n%d\n", mEtudiant.num, mEtudiant.nom, mEtudiant.prenom, mEtudiant.tabNotes[0], mEtudiant.tabNotes[1], mEtudiant.tabNotes[2], mEtudiant.tabNotes[3], mEtudiant.nbChoix);
|
|
|
|
|
afficherChoix(mEtudiant.lChoix);
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
@ -75,7 +75,7 @@ int chargerCandidats(Etudiant *tetud[])
|
|
|
|
|
fscanf(file, "%d%s%s", &tetud[i]->num, tetud[i]->nom, tetud[i]->prenom); // TODO : Faire un fgets pour le prénom
|
|
|
|
|
for (int note = 0; note < 4; note++)
|
|
|
|
|
{
|
|
|
|
|
fscanf(file, "%f", &tetud[i]->tabMatiere[note]);
|
|
|
|
|
fscanf(file, "%f", &tetud[i]->tabNotes[note]);
|
|
|
|
|
}
|
|
|
|
|
fscanf(file, "%d", &tetud[i]->nbChoix);
|
|
|
|
|
tetud[i]->lChoix = listenouvChoix();
|
|
|
|
@ -104,7 +104,7 @@ void sauvegarderCandidats(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
fprintf(file, "%d\n%s\n%s\n", tetud[i]->num, tetud[i]->nom, tetud[i]->prenom);
|
|
|
|
|
for (int note = 0; note < 4; note++)
|
|
|
|
|
{
|
|
|
|
|
fprintf(file, "%.2f\t", tetud[i]->tabMatiere[note]);
|
|
|
|
|
fprintf(file, "%.2f\t", tetud[i]->tabNotes[note]);
|
|
|
|
|
}
|
|
|
|
|
fprintf(file, "\n%d\n", tetud[i]->nbChoix);
|
|
|
|
|
sauvegarderChoix(tetud[i]->lChoix, file);
|
|
|
|
@ -120,115 +120,189 @@ void sauvegarderChoix(ListeChoix lChoix, FILE *file)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// void afficherCandidatsAdmis(ListeAdmission la)
|
|
|
|
|
// {
|
|
|
|
|
// while (!videCand(la->v.ldept))
|
|
|
|
|
// {
|
|
|
|
|
// if (la->v.ldept->v.decisionAdmission == 1)
|
|
|
|
|
// {
|
|
|
|
|
// afficherCandidats(la);
|
|
|
|
|
// }
|
|
|
|
|
// la->v.ldept = la->v.ldept->suiv;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// void afficherCandidatsNonAdmis(ListeAdmission la)
|
|
|
|
|
// {
|
|
|
|
|
// while (!videCand(la->v.ldept))
|
|
|
|
|
// {
|
|
|
|
|
// if (la->v.ldept->v.decisionAdmission == 0)
|
|
|
|
|
// {
|
|
|
|
|
// afficherCandidats(la);
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// void afficherCandidatsAttente(ListeAdmission la)
|
|
|
|
|
// {
|
|
|
|
|
// while (!videCand(la->v.ldept))
|
|
|
|
|
// {
|
|
|
|
|
// if (la->v.ldept->v.decisionAdmission == 2)
|
|
|
|
|
// {
|
|
|
|
|
// afficherCandidats(la);
|
|
|
|
|
// }
|
|
|
|
|
// la = la->suiv;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// void afficherCandidatsDpt(ListeAdmission la)
|
|
|
|
|
// {
|
|
|
|
|
// while (!videAdm(la->v.ldept))
|
|
|
|
|
// {
|
|
|
|
|
// afficherCandidats(la);
|
|
|
|
|
// la = la->suiv;
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// ListeAdmission MoyenneCandidats(ListeAdmission la)
|
|
|
|
|
// {
|
|
|
|
|
// while (!videAdm(la))
|
|
|
|
|
// {
|
|
|
|
|
// la->v.tabMatiere[4] = (la->v.tabMatiere[0] + la->v.tabMatiere[1] + la->v.tabMatiere[2] + la->v.tabMatiere[3]) / 4;
|
|
|
|
|
// la = la->suiv;
|
|
|
|
|
// }
|
|
|
|
|
// return la;
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// // Comment definir la note sur 20 mise lors de l'etude du dossier ?
|
|
|
|
|
// // Ajouter une variable dans la structure Admission ?
|
|
|
|
|
// // Ou mettre la liste et la note dans un tableau ?
|
|
|
|
|
// // Après examen de chaque dossier de candidature,
|
|
|
|
|
// // le jury doit regarder ou la note peut etre calculée automatiquement ?
|
|
|
|
|
|
|
|
|
|
// int modifNoteMinAdmis()
|
|
|
|
|
// {
|
|
|
|
|
// int noteMaths, noteFrançais, noteAnglais, noteSpe;
|
|
|
|
|
// printf("Entrez la nouvelle note minimale d'admission en maths (-1 pour quitter) : ");
|
|
|
|
|
// while (noteMaths < 0 || noteMaths > 20)
|
|
|
|
|
// {
|
|
|
|
|
// scanf("%d", ¬eMaths);
|
|
|
|
|
// if (noteMaths == -1)
|
|
|
|
|
// {
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// printf("La note doit être comprise entre 0 et 20 !\n");
|
|
|
|
|
// }
|
|
|
|
|
// printf("Entrez la nouvelle note minimale d'admission en français (-1 pour quitter) : ");
|
|
|
|
|
// while (noteFrançais < 0 || noteFrançais > 20)
|
|
|
|
|
// {
|
|
|
|
|
// scanf("%d", ¬eFrançais);
|
|
|
|
|
// if (noteFrançais == -1)
|
|
|
|
|
// {
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// printf("La note doit être comprise entre 0 et 20 !\n");
|
|
|
|
|
// }
|
|
|
|
|
// printf("Entrez la nouvelle note minimale d'admission en anglais (-1 pour quitter) : ");
|
|
|
|
|
// while (noteAnglais < 0 || noteAnglais > 20)
|
|
|
|
|
// {
|
|
|
|
|
// scanf("%d", ¬eAnglais);
|
|
|
|
|
// if (noteAnglais == -1)
|
|
|
|
|
// {
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// printf("La note doit être comprise entre 0 et 20 !\n");
|
|
|
|
|
// }
|
|
|
|
|
// printf("Entrez la nouvelle note minimale d'admission en spécialité (-1 pour quitter) : ");
|
|
|
|
|
// while (noteSpe < 0 || noteSpe > 20)
|
|
|
|
|
// {
|
|
|
|
|
// scanf("%d", ¬eSpe);
|
|
|
|
|
// if (noteSpe == -1)
|
|
|
|
|
// {
|
|
|
|
|
// break;
|
|
|
|
|
// }
|
|
|
|
|
// printf("La note doit être comprise entre 0 et 20 !\n");
|
|
|
|
|
// }
|
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
// int modifNbAdmisMax()
|
|
|
|
|
// {
|
|
|
|
|
// int nbAdmisMax;
|
|
|
|
|
// printf("Entrez le nouveau nombre d'admis maximum : ");
|
|
|
|
|
// scanf("%d", &nbAdmisMax);
|
|
|
|
|
// return nbAdmisMax;
|
|
|
|
|
// }
|
|
|
|
|
void afficherCandidatsAdmis(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
if (tetud[i]->lChoix->choix.decisionAdmission == 1)
|
|
|
|
|
{
|
|
|
|
|
afficherEtudiant(*tetud[i]);
|
|
|
|
|
}
|
|
|
|
|
tetud[i]->lChoix = tetud[i]->lChoix->suiv;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void afficherCandidatsRefuses(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
if (tetud[i]->lChoix->choix.decisionAdmission == -1)
|
|
|
|
|
{
|
|
|
|
|
afficherEtudiant(*tetud[i]);
|
|
|
|
|
}
|
|
|
|
|
tetud[i]->lChoix = tetud[i]->lChoix->suiv;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void afficherCandidatsAttente(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
if (tetud[i]->lChoix->choix.decisionAdmission == 2)
|
|
|
|
|
{
|
|
|
|
|
afficherEtudiant(*tetud[i]);
|
|
|
|
|
}
|
|
|
|
|
tetud[i]->lChoix = tetud[i]->lChoix->suiv;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Etudiant moyenneCandidat(Etudiant mEtudiant)
|
|
|
|
|
{
|
|
|
|
|
float moyenne = 0;
|
|
|
|
|
for (int i = 0; i < 4; i++)
|
|
|
|
|
{
|
|
|
|
|
moyenne += mEtudiant.tabNotes[i];
|
|
|
|
|
}
|
|
|
|
|
moyenne /= 4;
|
|
|
|
|
mEtudiant.tabNotes[moy] = moyenne;
|
|
|
|
|
return mEtudiant;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Etudiant *moyenneCandidats(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
tetud[i] = moyenneCandidat(*tetud[i]);
|
|
|
|
|
}
|
|
|
|
|
return tetud;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
Etudiant modifStatueCandidat(Etudiant *tetud[], int nbCandidats, float noteMin[], float noteExel[])
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
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])
|
|
|
|
|
{
|
|
|
|
|
tetud[i]->lChoix->choix.decisionAdmission = 2;
|
|
|
|
|
}
|
|
|
|
|
else if(tetud[i]->tabNotes[maths] >= noteExel[maths] && tetud[i]->tabNotes[francais] >= noteExel[francais] && tetud[i]->tabNotes[anglais] >= noteExel[anglais] && tetud[i]->tabNotes[spe] >= noteExel[spe] && tetud[i]->tabNotes[moy] >= noteExel[moy])
|
|
|
|
|
{
|
|
|
|
|
tetud[i]->lChoix->choix.decisionAdmission = 1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
tetud[i]->lChoix->choix.decisionAdmission = -1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return *tetud;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int statueCandidat(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
for(int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
if(tetud[i]->lChoix->choix.decisionAdmission == 1)
|
|
|
|
|
{
|
|
|
|
|
return 1;
|
|
|
|
|
}
|
|
|
|
|
else if(tetud[i]->lChoix->choix.decisionAdmission == -1)
|
|
|
|
|
{
|
|
|
|
|
return -1;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
return 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int nbCandidatsAdmis(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
int nbAdmis = 0;
|
|
|
|
|
for(int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
if(tetud[i]->lChoix->choix.decisionAdmission == 1)
|
|
|
|
|
{
|
|
|
|
|
nbAdmis++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nbAdmis;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int nbCandidatsRefuses(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
int nbRefuses = 0;
|
|
|
|
|
for(int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
if(tetud[i]->lChoix->choix.decisionAdmission == -1)
|
|
|
|
|
{
|
|
|
|
|
nbRefuses++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nbRefuses;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int nbCandidatsAttente(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
int nbAttente = 0;
|
|
|
|
|
for(int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
if(tetud[i]->lChoix->choix.decisionAdmission == 2)
|
|
|
|
|
{
|
|
|
|
|
nbAttente++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return nbAttente;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float modifNoteMin(float noteMin[])
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
for(int i = 0; i < 5; i++)
|
|
|
|
|
{
|
|
|
|
|
printf("Entrez la note minimale pour la matiere %s (0/20, -1 pour sortir) : ", i+1); // afficher le nom de la matiere du enum
|
|
|
|
|
scanf("%f", ¬eMin[i]);
|
|
|
|
|
while (tabNotes[i] < 0 || tabNotes[i] > 20)
|
|
|
|
|
{
|
|
|
|
|
scanf("%f", &tabNotes[i]);
|
|
|
|
|
if (noteMaths == -1)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
printf("La note doit être comprise entre 0 et 20 !\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return noteMin;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
float modifNoteExel(float noteExel[])
|
|
|
|
|
{
|
|
|
|
|
for(int i = 0; i < 5; i++)
|
|
|
|
|
{
|
|
|
|
|
printf("Entrez la note minimale pour la matiere %s (0/20, -1 pour sortir) : ", i+1); // afficher le nom de la matiere du enum
|
|
|
|
|
scanf("%f", ¬eExel[i]);
|
|
|
|
|
while (tabNotes[i] < 0 || tabNotes[i] > 20)
|
|
|
|
|
{
|
|
|
|
|
scanf("%f", &tabNotes[i]);
|
|
|
|
|
if (noteMaths == -1)
|
|
|
|
|
{
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
printf("La note doit être comprise entre 0 et 20 !\n");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return noteExel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int modifNbPlaces(int nbPlaces)
|
|
|
|
|
{
|
|
|
|
|
printf("Entrez le nombre de places disponibles : ");
|
|
|
|
|
scanf("%d", &nbPlaces);
|
|
|
|
|
return nbPlaces;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ? Comment definir la note sur 20 mise lors de l'etude du dossier ?
|
|
|
|
|
// ? Ajouter une variable dans la structure Admission ?
|
|
|
|
|
// ? Ou mettre la liste et la note dans un tableau ?
|
|
|
|
|
// ? Après examen de chaque dossier de candidature,
|
|
|
|
|
// ? le jury doit regarder ou la note peut etre calculée automatiquement ?
|
|
|
|
|