Modifications

master
Kyllian CHABANON 2 years ago
parent 4c450daac1
commit 405e7c7cde

@ -48,7 +48,10 @@ void modificationRespDept(VilleIUT *tiut[], int nbIUT);
// Partie 3
int rechercheCandidat(Etudiant *tetud[], int nbCandidats, int numRecherche, bool *trouve);
void afficherCandidat(Etudiant *tetud[], int nbCandidats);
void afficherEtudiant(Etudiant mEtudiant);
void afficherCandidats(Etudiant *tetud[], int nbCandidats);
void sauvegarderCandidats(Etudiant *tetud[], int nbCandidats);
void sauvegarderChoix(ListeChoix lChoix, FILE *flot);

@ -29,6 +29,7 @@ void modificationNbPDept(VilleIUT *tiut[], int nbIUT)
void creationDept(VilleIUT *tiut[], int nbIUT)
{
// TODO : Quand on essaie de créer un département dans un IUT inexistant, ça propose de le créer
char iut[30], nomDept[30], nomResp[30];
int posIUT, nbP;
bool trouve;

@ -82,9 +82,10 @@ void menuAdministrateur(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nb
printf("\t2 - Créer un département dans un IUT\n");
printf("\t3 - Supprimer un département d'un IUT\n");
printf("\t4 - Modifier le responsable d'un département\n");
printf("\t5 - Afficher les candidats\n");
printf("\t6 - Lancer la phase de candidature\n");
printf("\t7 - Stopper la phase de candidature\n");
printf("\t5 - Afficher les informations de tous les candidats\n");
printf("\t6 - Afficher les informations d'un seul candidat\n");
printf("\t7 - Lancer la phase de candidature\n");
printf("\t8 - Stopper la phase de candidature\n");
printf("\t9 - Quitter\n");
printf("\nEntrez votre choix :\n> ");
scanf("%d", &choix);
@ -103,10 +104,10 @@ void menuAdministrateur(VilleIUT *tiut[], int *nbIUT, Etudiant *tetud[], int *nb
modificationRespDept(tiut, *nbIUT);
break;
case 5:
afficherEtudiant(*tetud[0]);
afficherCandidats(tetud, *nbCandidats);
break;
case 6:
//
afficherCandidat(tetud, *nbCandidats);
break;
case 7:
//

@ -3,18 +3,55 @@
/* Partie 2 */
/*
Afficher les infos d'un candidat
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.tabMatiere[0], mEtudiant.tabMatiere[1], mEtudiant.tabMatiere[2], mEtudiant.tabMatiere[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;
@ -35,7 +72,7 @@ int chargerCandidats(Etudiant *tetud[])
printf("Erreur malloc");
exit(2);
}
fscanf(file, "%d%s%s", &tetud[i]->num, tetud[i]->nom, tetud[i]->prenom);
fscanf(file, "%d%s%s", &tetud[i]->num, tetud[i]->nom, tetud[i]->prenom); // TODO : Faire un fgets pour le prénom
for (int note = 0; note < 4; note++)
{
fscanf(file, "%f", &tetud[i]->tabMatiere[note]);

@ -13,11 +13,11 @@ Michel
Jacques
7.00 6.00 15.00 20.00
2
Grenoble
Clermont-Ferrand
Informatique
0
0
Clermont-Ferrand
Grenoble
Informatique
0
0

Loading…
Cancel
Save