|
|
@ -7,8 +7,9 @@
|
|
|
|
#include "../IV/quatre.c"
|
|
|
|
#include "../IV/quatre.c"
|
|
|
|
|
|
|
|
|
|
|
|
void calculerNoteGlobale(ListeCandidats liste, int nbCandidats) {
|
|
|
|
void calculerNoteGlobale(ListeCandidats liste, int nbCandidats) {
|
|
|
|
|
|
|
|
int i;
|
|
|
|
float noteGlobale;
|
|
|
|
float noteGlobale;
|
|
|
|
for(int i=0; i<nbCandidats; i++) {
|
|
|
|
for(i=0; i<nbCandidats; i++) {
|
|
|
|
noteGlobale = ((liste[i]->moyenneMath)*5
|
|
|
|
noteGlobale = ((liste[i]->moyenneMath)*5
|
|
|
|
+ (liste[i]->moyenneFrancais)*10
|
|
|
|
+ (liste[i]->moyenneFrancais)*10
|
|
|
|
+ (liste[i]->moyenneAnglais)*5
|
|
|
|
+ (liste[i]->moyenneAnglais)*5
|
|
|
@ -19,6 +20,7 @@ void calculerNoteGlobale(ListeCandidats liste, int nbCandidats) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void afficherCandidaturesByDept(ListeCandidats liste, int nbCandidats, char* searchIUT, char* searchDept) {
|
|
|
|
void afficherCandidaturesByDept(ListeCandidats liste, int nbCandidats, char* searchIUT, char* searchDept) {
|
|
|
|
|
|
|
|
int i, j;
|
|
|
|
char decision[LEN_MAX], validation[LEN_MAX];
|
|
|
|
char decision[LEN_MAX], validation[LEN_MAX];
|
|
|
|
ListeCandidatures candidatures;
|
|
|
|
ListeCandidatures candidatures;
|
|
|
|
Candidature* candidature;
|
|
|
|
Candidature* candidature;
|
|
|
@ -30,16 +32,16 @@ void afficherCandidaturesByDept(ListeCandidats liste, int nbCandidats, char* sea
|
|
|
|
exit(errno);
|
|
|
|
exit(errno);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
for (int i=0; i<nbCandidats; i++) {
|
|
|
|
for(i=0; i<nbCandidats; i++) {
|
|
|
|
memcpy(&listeTriee[i], &liste[i], sizeof(Candidat*));
|
|
|
|
memcpy(&listeTriee[i], &liste[i], sizeof(Candidat*));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
qsort(listeTriee, nbCandidats, sizeof(Candidat*), compareCandidats);
|
|
|
|
qsort(listeTriee, nbCandidats, sizeof(Candidat*), compareCandidats);
|
|
|
|
|
|
|
|
|
|
|
|
for(int i=0; i<nbCandidats; i++) {
|
|
|
|
for(i=0; i<nbCandidats; i++) {
|
|
|
|
candidatures = listeTriee[i]->listeCandidatures;
|
|
|
|
candidatures = listeTriee[i]->listeCandidatures;
|
|
|
|
|
|
|
|
|
|
|
|
for(int j=0; j<listeTriee[i]->nbCandidatures; j++) {
|
|
|
|
for(j=0; j<listeTriee[i]->nbCandidatures; j++) {
|
|
|
|
candidature = candidatures[j];
|
|
|
|
candidature = candidatures[j];
|
|
|
|
|
|
|
|
|
|
|
|
if(strcasecmp(candidature->ville, searchIUT) == 0) {
|
|
|
|
if(strcasecmp(candidature->ville, searchIUT) == 0) {
|
|
|
@ -131,7 +133,7 @@ void afficherCandidatTraite(Candidat candidat) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void traiterCandidatures(ListeCandidats liste, int nbCandidats, int nbCandidatsAccept, float noteMini) {
|
|
|
|
void traiterCandidatures(ListeCandidats liste, int nbCandidats, int nbCandidatsAccept, float noteMini) {
|
|
|
|
int i, j, nbCandidatsMatch = 0;
|
|
|
|
int i, j, nbCandidatsMatch = 0, nbAdmis=0, nbAttente=0, nbRefuse=0;
|
|
|
|
char dept[LEN_MAX], ville[LEN_MAX], fNameAdmis[100], fNameAttente[100];
|
|
|
|
char dept[LEN_MAX], ville[LEN_MAX], fNameAdmis[100], fNameAttente[100];
|
|
|
|
FILE* fAdmis, *fAttente;
|
|
|
|
FILE* fAdmis, *fAttente;
|
|
|
|
Candidature* candidature;
|
|
|
|
Candidature* candidature;
|
|
|
@ -161,7 +163,6 @@ void traiterCandidatures(ListeCandidats liste, int nbCandidats, int nbCandidatsA
|
|
|
|
calculerNoteGlobale(listeCandidatsMatch, nbCandidatsMatch); // Calcul des notes de chaque candidat
|
|
|
|
calculerNoteGlobale(listeCandidatsMatch, nbCandidatsMatch); // Calcul des notes de chaque candidat
|
|
|
|
triDichotomiqueFusion(listeCandidatsMatch, 0, nbCandidatsMatch-1); // Trie les candidats selon leur noteGlobale
|
|
|
|
triDichotomiqueFusion(listeCandidatsMatch, 0, nbCandidatsMatch-1); // Trie les candidats selon leur noteGlobale
|
|
|
|
|
|
|
|
|
|
|
|
int nbAdmis=0, nbAttente=0, nbRefuse=0;
|
|
|
|
|
|
|
|
for(i=0; i<nbCandidatsMatch; i++) {
|
|
|
|
for(i=0; i<nbCandidatsMatch; i++) {
|
|
|
|
if(listeCandidatsMatch[i]->noteGlobale >= noteMini) {
|
|
|
|
if(listeCandidatsMatch[i]->noteGlobale >= noteMini) {
|
|
|
|
if(nbAdmis < nbCandidatsAccept) {
|
|
|
|
if(nbAdmis < nbCandidatsAccept) {
|
|
|
|