SAE S1.02 - Comparaison d'approches algorithmiques
SAE.h
1 #include <stdio.h>
2 #include <stdlib.h>
3 #include <string.h>
4 #include <stdbool.h>
5 #include "structures.h"
6 
7 void global(void);
8 
9 /* Menus */
10 void menu(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats, bool *phaseCandidatures, bool *phaseTraitement, Etudiant *tetudAdmis[], int *nbEtudAdmis, Etudiant *tetudAttente[], int *nbEtudAttente);
11 void menuAdministrateur(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats, bool *phaseCandidatures, bool *phaseTraitement);
12 void menuUtilisateur(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats);
13 void menuCandidat(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats);
14 void menuResponsable(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int *nbIUT, Etudiant *tetudAdmis[], int *nbEtudAdmis, Etudiant *tetudAttente[], int *nbEtudAttente);
15 void menuAffichage(Etudiant *tetudResp[], int nbCandidatsDept, int *nbCandidatsAdmis, int *nbCandidatsAttente);
16 void menuPostCandidat(Etudiant *tetud[], int *nbCandidats);
17 
18 
19 /* Partie 1 */
20 /* Fichier */
21 int chargementVillesIUT(VilleIUT *tiut[]);
22 int rechercheVille(VilleIUT *tiut[], int nbIUT, char val[], bool *trouve);
23 void sauvegardeVillesIUT(VilleIUT *tiut[], int nbIUT);
24 
25 /* Utilisateur */
26 void affichageVillesIUT(VilleIUT *tiut[], int nbIUT);
27 void affichageDeptIUT(VilleIUT *tiut[], int nbIUT);
28 void affichageNbP(VilleIUT *tiut[], int nbIUT);
29 void affichageDeptParticulier(VilleIUT *tiut[], int nbIUT);
30 
31 /* Administrateur */
32 void modificationNbPDept(VilleIUT *tiut[], int nbIUT);
33 void creationDept(VilleIUT *tiut[], int nbIUT);
34 int suppressionDept(VilleIUT *tiut[], int nbIUT);
35 void modificationRespDept(VilleIUT *tiut[], int nbIUT);
36 void lancerPhaseCandidature(bool *phaseCandidatures, bool *phaseTraitement);
37 void stopperPhaseCandidature(bool *phaseCandidatures, bool *phaseTraitement);
38 
39 /* Partie 2 */
40 int rechercheCandidat(Etudiant *tetud[], int nbCandidats, int numRecherche, bool *trouve);
41 void afficherEtudiant(Etudiant mEtudiant);
42 void afficherCandidat(Etudiant *tetud[], int nbCandidats);
43 void afficherCandidats(Etudiant *tetud[], int nbCandidats);
44 int chargerCandidats(Etudiant *tetud[]);
45 void sauvegarderCandidats(Etudiant *tetud[], int nbCandidats, char nomFichier[]);
46 void sauvegarderChoix(ListeChoix lChoix, FILE *flot);
47 
48 void modificationNbPDeptResp(VilleIUT *tiut[], int nbIUT, char respVille[30], char respDept[30]);
49 void afficherCandidatsAdmis(Etudiant *tetud[], int nbCandidats);
50 void afficherCandidatsRefuses(Etudiant *tetud[], int nbCandidats);
51 void afficherCandidatsAttente(Etudiant *tetud[], int nbCandidats);
52 Etudiant modifStatueCandidat(Etudiant *tetud[], int nbCandidats, float noteMin[], VilleIUT *tiut[], int nbIUT, char respVille[30], char respDept[30]);
53 void statueCandidat(Etudiant *tetud[], int nbCandidats, Etudiant *tetudAdmis[], Etudiant *tetudAttente[], int *nbEtudAdmis, int *nbEtudAttente);
54 int nbCandidatsAdmis(Etudiant *tetud[], int nbCandidats);
55 int nbCandidatsRefuses(Etudiant *tetud[], int nbCandidats);
56 int nbCandidatsAttente(Etudiant *tetud[], int nbCandidats);
57 float modifNoteMin(float noteMin[]);
58 void ajouterCandidature(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int nbVillesIUT);
59 void supprimerCandidature(Etudiant *tetud[], int nbCandidats);
60 int inscription(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int nbVillesIUT);
61 
62 
63 int plusPetit(Etudiant *tetudResp[], int nbCandResp);
64 void echanger(Etudiant *tetudResp[], int i, int j);
65 void triNote(Etudiant *tetudResp[], int nbCandResp);
66 void deptResp(VilleIUT *tiut[], int nbVilles, char respVille[], char respIUT[]);
67 int chargementRespDept(Etudiant *tetud[], int nbCand, char respVille[], char respIUT[], Etudiant *tetudResp[]);
68 void sauvegardeAdmis(Etudiant *tetudAdmis[], int nbEtudAdmis);
69 void sauvegardeAttente(Etudiant *tetudAttente[], int nbEtudAttente);
70 void sauvegardeTousCandidats(Etudiant *tetud[], int nbCandidats);
71 void libererEspaceCandidats(Etudiant *tetud[], int nbCandidats);
72 void libererEspaceIUT(VilleIUT *tiut[], int nbIUT);
void lancerPhaseCandidature(bool *phaseCandidature, bool *phaseTraitement)
Lance la phase de candidatures et arrête celle de traitement.
Definition: administrateur.c:124
void modificationNbPDept(VilleIUT *tiut[], int nbIUT)
Permet de modifier le nombre de places dans un département.
Definition: administrateur.c:17
void stopperPhaseCandidature(bool *phaseCandidature, bool *phaseTraitement)
Lance la phase de traitement et arrête celle de candidature.
Definition: administrateur.c:145
void creationDept(VilleIUT *tiut[], int nbIUT)
Permet de créer un département dans un IUT, et un IUT s'il n'existe pas.
Definition: administrateur.c:51
void modificationRespDept(VilleIUT *tiut[], int nbIUT)
Permet de modifier le responsable d'un département.
Definition: administrateur.c:88
void affichageDeptIUT(VilleIUT *tiut[], int nbIUT)
Affiche les départements de chaque IUT.
Definition: affichage.c:33
void affichageNbP(VilleIUT *tiut[], int nbIUT)
Affiche le nombre de places dans chaque département.
Definition: affichage.c:50
void afficherCandidatsRefuses(Etudiant *tetud[], int nbCandidats)
Affiche les candidats refusés.
Definition: affichage.c:174
void affichageVillesIUT(VilleIUT *tiut[], int nbIUT)
Affiche les villes contenant un IUT.
Definition: affichage.c:17
void afficherCandidatsAdmis(Etudiant *tetud[], int nbCandidats)
Affiche les candidats admis.
Definition: affichage.c:154
void afficherCandidats(Etudiant *tetud[], int nbCandidats)
Affiche les informations de tous les candidats.
Definition: affichage.c:134
void affichageDeptParticulier(VilleIUT *tiut[], int nbIUT)
Affiche un département particulier.
Definition: affichage.c:70
void afficherCandidatsAttente(Etudiant *tetud[], int nbCandidats)
Affiche les candidats sur liste d'attente.
Definition: affichage.c:194
void afficherCandidat(Etudiant *tetud[], int nbCandidats)
Affiche les informations d'un candidat particulier.
Definition: affichage.c:112
void afficherEtudiant(Etudiant mEtudiant)
Affiche les informations d'un candidat.
Definition: affichage.c:98
int inscription(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int nbVillesIUT)
Permet à un utilisateur de s'inscrire en tant que candidat.
Definition: candidatures.c:67
void ajouterCandidature(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int nbVillesIUT)
Ajoute une candidature à un candidat.
Definition: candidatures.c:20
int chargerCandidats(Etudiant *tetud[])
Charge le fichier des candidats dans un tableau de pointeurs et retourne le nombre de candidats.
Definition: chargement.c:73
int chargementVillesIUT(VilleIUT *tiut[])
Charge le fichier des IUT dans un tableau de pointeurs et retourne le nombre d'IUT.
Definition: chargement.c:17
void menu(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats, bool *phaseCandidatures, bool *phaseTraitement, Etudiant *tetudAdmis[], int *nbEtudAdmis, Etudiant *tetudAttente[], int *nbEtudAttente)
Fonction de sélection des menus.
Definition: menus.c:25
void menuResponsable(Etudiant *tetud[], int nbCandidats, VilleIUT *tiut[], int *nbIUT, Etudiant *tetudAdmis[], int *nbEtudAdmis, Etudiant *tetudAttente[], int *nbEtudAttente)
Menu des responsables.
Definition: menus.c:254
void menuAdministrateur(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats, bool *phaseCandidatures, bool *phaseTraitement)
Menu des administrateurs.
Definition: menus.c:92
void menuCandidat(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats)
Menu des candidats.
Definition: menus.c:203
void menuAffichage(Etudiant *tetudResp[], int nbEtudDept, int *nbEtudAdmis, int *nbEtudAttente)
Menu d'affichage des responsables.
Definition: menus.c:314
void menuUtilisateur(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nbCandidats)
Menu des utilisateurs.
Definition: menus.c:156
int rechercheVille(VilleIUT *tiut[], int nb, char val[], bool *trouve)
Retourne la position de l'IUT recherché et un booléen qui prend la valeur true si l'élément a été tro...
Definition: recherche.c:20
int rechercheCandidat(Etudiant *tetud[], int nbCandidats, int numRecherche, bool *trouve)
Retourne la position du candidat recherché et un booléen qui prend la valeur true si l'élément a été ...
Definition: recherche.c:45
int chargementRespDept(Etudiant *tetud[], int nbCand, char respVille[], char respIUT[], Etudiant *tetudResp[])
Charge le tableau des candidats ayant candidatés dans le département du responsable.
Definition: responsable.c:50
int nbCandidatsAdmis(Etudiant *tetud[], int nbCandidats)
Retourne le nombre de candidats admis.
Definition: responsable.c:151
void statueCandidat(Etudiant *tetud[], int nbCandidats, Etudiant *tetudAdmis[], Etudiant *tetudAttente[], int *nbEtudAdmis, int *nbEtudAttente)
Ajoute les candidats dans les tableaux des candidats admis et en attente.
Definition: responsable.c:125
Etudiant modifStatueCandidat(Etudiant *tetud[], int nbCandidats, float noteMin[], VilleIUT *tiut[], int nbIUT, char respVille[30], char respDept[30])
Modification du statut d'un candidat.
Definition: responsable.c:80
void deptResp(VilleIUT *tiut[], int nbVilles, char respVille[], char respIUT[])
Renvoie par adresse le département et la ville du département duquel le responsable s'occupe.
Definition: responsable.c:19
int plusPetit(Etudiant *tetudResp[], int nbCandResp)
Retourne l'emplacement du plus petit élément dans un tableau.
Definition: responsable.c:305
int nbCandidatsRefuses(Etudiant *tetud[], int nbCandidats)
Retourne le nombre de candidats refusés.
Definition: responsable.c:172
void echanger(Etudiant *tetudResp[], int i, int j)
Permute deux cases d'un tableau.
Definition: responsable.c:289
float modifNoteMin(float noteMin[])
Retourne les notes minimales.
Definition: responsable.c:213
int nbCandidatsAttente(Etudiant *tetud[], int nbCandidats)
Retourne le nombre de candidats en attente.
Definition: responsable.c:193
void triNote(Etudiant *tetudResp[], int nbCandResp)
Trie le tableau des candidats par moyenne.
Definition: responsable.c:270
void modificationNbPDeptResp(VilleIUT *tiut[], int nbIUT, char respVille[30], char respDept[30])
Modifie le nombre de places du département.
Definition: responsable.c:241
void sauvegardeAdmis(Etudiant *tetudAdmis[], int nbEtudAdmis)
Sauvegarde le tableau des candidats admis.
Definition: sauvegarde.c:107
void sauvegarderCandidats(Etudiant *tetud[], int nbCandidats, char nomFichier[])
Sauvegarde les tableaux des candidats dans leurs fichiers respectifs.
Definition: sauvegarde.c:50
void sauvegardeVillesIUT(VilleIUT *tiut[], int nb)
Sauvegarde le tableau des IUT dans le fichier des IUT.
Definition: sauvegarde.c:17
void sauvegardeTousCandidats(Etudiant *tetud[], int nbCandidats)
Sauvegarde tous les candidats.
Definition: sauvegarde.c:96
void sauvegardeAttente(Etudiant *tetudAttente[], int nbEtudAttente)
Sauvegarde le tableau des candidats en attente.
Definition: sauvegarde.c:119
void libererEspaceIUT(VilleIUT *tiut[], int nbIUT)
Libère l'espace alloué au tableau des IUT.
Definition: sauvegarde.c:144
void sauvegarderChoix(ListeChoix lChoix, FILE *file)
Sauvegarde les choix d'un candidat.
Definition: sauvegarde.c:80
void libererEspaceCandidats(Etudiant *tetud[], int nbCandidats)
Libère l'espace alloué au tableau des candidats.
Definition: sauvegarde.c:130
Structure d'un candidat.
Definition: structures.h:66
Structure d'une ville possédant un IUT.
Definition: structures.h:30
Maillon d'une liste de choix.
Definition: structures.h:55
Fichier qui contient toutes les définitions de structures ainsi que les prototypes des fonctions rela...
void supprimerCandidature(Etudiant *tetud[], int nbCandidats)
Supprime un choix d'un candidat.
Definition: suppression.c:16
int suppressionDept(VilleIUT *tiut[], int nbIUT)
Permet de supprimer un département, et un IUT s'il n'a plus aucun département.
Definition: suppression.c:52