You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
228 lines
6.9 KiB
228 lines
6.9 KiB
#include "SAE.h"
|
|
|
|
// Departement lireDept(FILE *flot, ListeDepartement dpt)
|
|
// {
|
|
// fscanf(flot, "%s\n%d\n%d\n", dpt.departement, &dpt.decisionAdmission, &dpt.decisionCandidat);
|
|
// return dpt;
|
|
// }
|
|
|
|
// void afficheDept(Departement dpt)
|
|
// {
|
|
// printf("\t%s\t%d\t%d", dpt.departement, dpt.decisionAdmission, dpt.decisionCandidat);
|
|
// }
|
|
|
|
// Admission lireCandidat(FILE *flot, ListeAdmission la, char dptResAdmis[])
|
|
// {
|
|
// int i = 0;
|
|
// fscanf(flot, "%d\n", &la->v.num);
|
|
// fgets(la->v.nom, 22, flot);
|
|
// la->v.nom[strlen(la->v.nom) - 1] = '\0';
|
|
// fgets(la->v.prenom, 22, flot);
|
|
// la->v.prenom[strlen(la->v.prenom) - 1] = '\0';
|
|
// fscanf(flot, "%d\t%d\t%d\t%d\n%d\n%s\n", &la->v.tabMatiere[0], &la->v.tabMatiere[1], &la->v.tabMatiere[2], &la->v.tabMatiere[3], &la->v.nbChoix, la->v.ville);
|
|
// if (la->v.nbChoix == 0)
|
|
// {
|
|
// listenouv();
|
|
// return la->v;
|
|
// }
|
|
// ajouterDpt(la->v.ldept, lireDept(flot, la->v.ldept));
|
|
// while (!feof(flot) && i < la->v.nbChoix)
|
|
// {
|
|
// if (strcmp(la->v.ldept, dptResAdmi) == 0)
|
|
// {
|
|
// la->v.ldept = insererDpt(la->v.ldept, la->v.ldept->v.departement);
|
|
// }
|
|
// ajouterDpt(la->v.ldept, lireDept(flot, la->v.ldept));
|
|
// i++;
|
|
// }
|
|
// return la->v;
|
|
// }
|
|
|
|
// void afficherCandidats(ListeAdmission la)
|
|
// {
|
|
// int i;
|
|
// printf("%d\t%s\t%s\t%d\t%d\t%d\t%d\t%d\t%s\t%s\t%d\t%d", la->v.num, la->v.nom, la->v.prenom, la->v.tabMatiere[0], la->v.tabMatiere[1], la->v.tabMatiere[2], la->v.tabMatiere[3], la->v.nbChoix, la->v.ville);
|
|
// for (i = 0; i < la->v.nbChoix; i++)
|
|
// {
|
|
// afficherDpt(la->v.ldept->v);
|
|
// la->v.ldept = la->v.ldept->suiv;
|
|
// }
|
|
// printf("\n");
|
|
// }
|
|
|
|
// Regarder si le nombre de choix est = à 0 Que se passe-t-il ?
|
|
|
|
int chargerCandidats(MaillonEtudiant *tetud[])
|
|
{
|
|
FILE *file;
|
|
file = fopen("resultats.txt", "r");
|
|
int nbCandidats, i = 0;
|
|
Choix choix;
|
|
if (file == NULL)
|
|
{
|
|
printf("Erreur d'ouverture du fichier !\n");
|
|
exit(1);
|
|
}
|
|
fscanf(file, "%d", &nbCandidats);
|
|
while (i < nbCandidats - 1)
|
|
{
|
|
tetud[i] = (MaillonEtudiant *)malloc(sizeof(MaillonEtudiant));
|
|
if (tetud[i] == NULL)
|
|
{
|
|
printf("Erreur malloc");
|
|
exit(2);
|
|
}
|
|
fscanf(file, "%d%s", &tetud[i]->num, tetud[i]->nom);
|
|
fgets(tetud[i]->prenom, 22, file);
|
|
tetud[i]->prenom[strlen(tetud[i]->prenom - 1)] = '\0';
|
|
for (int note = 0; note < 4; note++)
|
|
{
|
|
fscanf(file, "%f", tetud[i]->tabMatiere[note]);
|
|
}
|
|
fscanf(file, "%d", &tetud[i]->nbChoix);
|
|
tetud[i]->lChoix = listenouvChoix();
|
|
for (int n = 0; n < tetud[i]->nbChoix; n++)
|
|
{
|
|
fscanf(file, "%s%s%d%d", choix.ville, choix.departement, &choix.decisionAdmission, &choix.decisionCandidat);
|
|
tetud[i]->lChoix = insererChoix(tetud[i]->lChoix, choix);
|
|
}
|
|
i++;
|
|
}
|
|
return i + 1;
|
|
}
|
|
|
|
// void sauvegarderCandidats(ListeAdmission la, char dptResAdmi[30])
|
|
// {
|
|
// FILE *flot;
|
|
// flot = fopen("admissionInfo.txt", "w");
|
|
// if (flot == NULL)
|
|
// {
|
|
// printf("Erreur d'ouverture du fichier !\n");
|
|
// exit(1);
|
|
// }
|
|
// while (!videAdm(la))
|
|
// {
|
|
// fprintf(flot, "%d\n%s\n%s\n%d\t%d\t%d\t%d\n%d\n%s\n", la->v.num, la->v.nom, la->v.prenom, la->v.tabMatiere[0], la->v.tabMatiere[1], la->v.tabMatiere[2], la->v.tabMatiere[3], la->v.nbChoix, la->v.ville);
|
|
// while (!videDpt(la->v.ldept))
|
|
// {
|
|
// fprintf(flot, "%s\n%d\n%d\n", la->v.ldept->v.departement, la->v.ldept->v.decisionAdmission, la->v.ldept->v.decisionCandidat);
|
|
// la->v.ldept = la->v.ldept->suiv;
|
|
// }
|
|
// la = la->suiv;
|
|
// }
|
|
// fclose(flot);
|
|
// }
|
|
|
|
// 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;
|
|
// }
|