diff --git a/SAE b/SAE index ddf5ef2..417d2d0 100755 Binary files a/SAE and b/SAE differ diff --git a/src/partie1/saeP1.c b/src/partie1/saeP1.c index 8cabde3..b7ef22e 100644 --- a/src/partie1/saeP1.c +++ b/src/partie1/saeP1.c @@ -75,11 +75,11 @@ void SearchPlaceFromDepInIUT(VilleIUT* lvIUT[],int tlogi) int boolF=0, i; printf("Entrez le nom de la ville contenant le département recherché :\n"); scanf("%s",sVille); - printf("Département y étant disponible :\n"); for (i=0;iVille==sVille) + if (strcmp(lvIUT[i]->Ville,sVille)) { + printf("Département y étant disponible :\n"); MaillonDep* MaillonAct=lvIUT[i]->ldept; while (MaillonAct!=NULL) printf("%s",MaillonAct->departement); boolF=1; @@ -98,7 +98,7 @@ void SearchPlaceFromDepInIUT(VilleIUT* lvIUT[],int tlogi) while (MaillonAct!=NULL) { - if(MaillonAct->departement==sDep) + if(strcmp(MaillonAct->departement,sDep)) { printf("Nombre de place : %d\n",MaillonAct->nbp); return; diff --git a/src/partie2/saeP2.c b/src/partie2/saeP2.c index 7dfa7dc..88d526a 100644 --- a/src/partie2/saeP2.c +++ b/src/partie2/saeP2.c @@ -2,6 +2,7 @@ #include #include #include "saeP2.h" +#include candidat* LoadCandid(void) { @@ -15,93 +16,72 @@ candidat* LoadCandid(void) //Lire la première ligne pr savoir combien d'étudiant je vais lire int nbcandid; fread(&nbcandid,sizeof(int),1,file); - candidat* Listecandidat=(candidat*) malloc (sizeof(candidat)*nbcandid); + candidat* Tabcandidat=(candidat*) malloc (sizeof(candidat)*nbcandid); //Tant que j'ai des étudiants à lire : for(int i=0;nbcandid>i;++i) { //Son numéro, Son nom, Son prenom, liste de note` candidat Candidat_ajout; - int numcandid; - char surname[31]; - char name[31]; - float note[4]; - fread(&numcandid,sizeof(int),1,file); - fread(surname,sizeof(char)*31,1,file); - fread(name,sizeof(char)*31,1,file); - fread(note,sizeof(int)*4,1,file); + fread(&Candidat_ajout.numcandid,sizeof(int),1,file); + fread(Candidat_ajout.surname,sizeof(char)*31,1,file); + fread(Candidat_ajout.name,sizeof(char)*31,1,file); + fread(Candidat_ajout.note,sizeof(float)*4,1,file); //Son nb de choix - int nbchoix; - fread(&nbchoix,sizeof(int),1,file); + fread(&Candidat_ajout.nbchoix,sizeof(int),1,file); //Tant que j'ai pas fait tout ces choix : - voeu* ListeVoeu_ajout=NULL; - for(int y=0;yville,sizeof(char)*31,1,file); + fread(voeu_ajout->dep,sizeof(char)*31,1,file); + fread(&voeu_ajout->ddep,sizeof(int),1,file); + fread(&voeu_ajout->vcand,sizeof(int),1,file); + Candidat_ajout.TabVoeu[i]=voeu_ajout; } - Candidat_ajout.numcandid=numcandid; - Candidat_ajout.surname=surname; - Candidat_ajout.name=name; - Candidat_ajout.note=note; - Candidat_ajout.ListeVoeu=ListeVoeu_ajout; - Listecandidat[i]=Candidat_ajout; + Tabcandidat[i]=Candidat_ajout; } //Je sors en disant que le load est sucessful printf("Chargement réussie."); - return Listecandidat; + return Tabcandidat; } -/* -void RechercheCandidat(int ID, int nbcandidat, int tmax,candidat *tcand) + +void RechercheCandidat(int ID, int nbcandidat, int tmax,candidat *tcandidat) { for(int i=0;iville,tcandidat[i].TabVoeu[y]->dep); + if(tcandidat[i].TabVoeu[y]->ddep==0) printf("Dossier non traité\n"); else { - if(==1) printf("Admis\n"); + if(tcandidat[i].TabVoeu[y]->ddep==1) printf("Admis\n"); else { - if (==2) printf("Liste d'attente\n"); + if (tcandidat[i].TabVoeu[y]->ddep==2) printf("Liste d'attente\n"); else printf("Refusé\n"); } } - printf("Décision du candidat : ") - if(==0) printf("Décision non rendu\n"); + printf("Décision du candidat : "); + if(tcandidat[i].TabVoeu[y]->vcand==0) printf("Décision non rendu\n"); else { - if(==1) printf("Accepté\n"); - else prinf("Refusé"); + if(tcandidat[i].TabVoeu[y]->vcand==1) printf("Accepté\n"); + else printf("Refusé"); } } return; @@ -110,5 +90,6 @@ void RechercheCandidat(int ID, int nbcandidat, int tmax,candidat *tcand) printf("Candidat non trouvé"); return; } + //void gestionPhaseCandidatures(); A FAIRE.*/ diff --git a/src/partie2/saeP2.h b/src/partie2/saeP2.h index 527fa4a..4d1ac16 100644 --- a/src/partie2/saeP2.h +++ b/src/partie2/saeP2.h @@ -12,10 +12,11 @@ typedef struct int numcandid; char surname[31]; char name[31]; - int note[4]; - voeu ListeVoeu[100]; + float note[4]; + int nbchoix; + voeu* TabVoeu[20]; }candidat; candidat* LoadCandid(void); - +void RechercheCandidat(int ID, int nbcandidat, int tmax,candidat* tcandidat); //void gestionPhaseCandidatures(); A FAIRE.