|
|
|
@ -6,52 +6,6 @@
|
|
|
|
|
|
|
|
|
|
Afficher la liste des candidats par departement trié par ordre alphabetique
|
|
|
|
|
*/
|
|
|
|
|
int rechercheCandidat(Etudiant *tetud[], int nbCandidats, int numRecherche, bool *trouve)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
if (numRecherche == tetud[i]->num)
|
|
|
|
|
{
|
|
|
|
|
*trouve = true;
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*trouve = false;
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
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.tabNotes[0], mEtudiant.tabNotes[1], mEtudiant.tabNotes[2], mEtudiant.tabNotes[3], mEtudiant.nbChoix);
|
|
|
|
|
afficherChoix(mEtudiant.lChoix);
|
|
|
|
|
printf("\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void afficherCandidat(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
int num, index;
|
|
|
|
|
bool trouve;
|
|
|
|
|
printf("Veuillez entrer le numéro de l'étudiant recherché :\n> ");
|
|
|
|
|
scanf("%d", &num);
|
|
|
|
|
index = rechercheCandidat(tetud, nbCandidats, num, &trouve);
|
|
|
|
|
if (trouve == false)
|
|
|
|
|
{
|
|
|
|
|
printf("Le numéro de l'étudiant recherché n'existe pas.\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
afficherEtudiant(*tetud[index]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void afficherCandidats(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
afficherEtudiant(*tetud[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int chargerCandidats(Etudiant *tetud[])
|
|
|
|
|
{
|
|
|
|
|
FILE *file;
|
|
|
|
@ -111,6 +65,51 @@ void sauvegarderCandidats(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int rechercheCandidat(Etudiant *tetud[], int nbCandidats, int numRecherche, bool *trouve)
|
|
|
|
|
{
|
|
|
|
|
int i;
|
|
|
|
|
for (i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
if (numRecherche == tetud[i]->num)
|
|
|
|
|
{
|
|
|
|
|
*trouve = true;
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
*trouve = false;
|
|
|
|
|
return i;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void afficherEtudiant(Etudiant mEtudiant)
|
|
|
|
|
{
|
|
|
|
|
printf("Numéro : %d\nNom : %s\nPrénom :%s\nNotes : %.2f\t%.2f\t%.2f\t%.2f\nNombre de choix : %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");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void afficherCandidat(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
int num, index;
|
|
|
|
|
bool trouve;
|
|
|
|
|
printf("Veuillez entrer le numéro de l'étudiant recherché :\n> ");
|
|
|
|
|
scanf("%d", &num);
|
|
|
|
|
index = rechercheCandidat(tetud, nbCandidats, num, &trouve);
|
|
|
|
|
if (trouve == false)
|
|
|
|
|
{
|
|
|
|
|
printf("Le numéro de l'étudiant recherché n'existe pas.\n");
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
afficherEtudiant(*tetud[index]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void afficherCandidats(Etudiant *tetud[], int nbCandidats)
|
|
|
|
|
{
|
|
|
|
|
for (int i = 0; i < nbCandidats; i++)
|
|
|
|
|
{
|
|
|
|
|
afficherEtudiant(*tetud[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void sauvegarderChoix(ListeChoix lChoix, FILE *file)
|
|
|
|
|
{
|
|
|
|
|
if (lChoix != NULL)
|
|
|
|
@ -304,6 +303,13 @@ int modifNbPlaces(int nbPlaces)
|
|
|
|
|
return nbPlaces;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
int ajouterCandidat(Candidat *tiut[])
|
|
|
|
|
{
|
|
|
|
|
Candidat cand;
|
|
|
|
|
printf("Entrez votre nom et votre prénom :\n> ");
|
|
|
|
|
scanf("%s%s", cand.nom, cand.prenom)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ? 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 ?
|
|
|
|
|