diff --git a/part2.c b/part2.c index 2f9083d..88f9df2 100644 --- a/part2.c +++ b/part2.c @@ -32,8 +32,10 @@ Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier scanf("%d%*c", &c.nEtu); printf("Nom du candidat :\n"); fgets(c.nom, 20, stdin); + c.nom[strlen(c.nom)-1]= '\0'; printf("Prénom du candidat :\n"); fgets(c.prenom, 20, stdin); + c.prenom[strlen(c.prenom)-1]= '\0'; printf("Moyenne de maths :\n"); scanf("%f", &c.moymat); printf("Moyenne de français :\n"); @@ -67,7 +69,21 @@ void AffC(Candidat c) } +Candidat lireFich1Cand (FILE * fe){ + Candidat cand; + fgets(cand.nom, 20, fe); + c.nom[strlen(c.nom)-1]= '\0'; + + fgets(c.prenom, 20, fe); + c.prenom[strlen(cand.prenom)-1]= '\0'; + + fscanf(fe, "%f", &c.moymat); + fscanf(fe, "%f", &c.moyfr); + fscanf(fe, "%f", &c.moyen); + fscanf(fe, "%f", &c.moyspe); + fscanf(fe, "%d%*c", &c.nbchx); +} ######################################### LISTES ########################################## @@ -94,7 +110,40 @@ Liste recherche (Liste l, char *nom ){ +void test (void){ + + int menu1, menugest1; + + + printf("Menu :\n");//Premier affichage menu pour choisir si on veut afficher le menu d'un candidat ou toutes les candidatures + printf("(1) Gestion Candidature\n(2) Affichage Candidature\n"); + scanf("%d", &menu1); + while (menu1 != 1 || menu1 !=2){// Traitement des erreurs + printf("Erreur de saisie veuillez refaire votre choix ! "); + printf("(1) Gestion Candidature\n(2) Affichage Candidature\n (3) Quitter"); + scanf("%d", &menu1); + } + + if (menu1 == 1){ + printf("Menu : \n");//Menu gestion ajout/modification/suppression d'une candidature + printf("(1) Ajouter une Candidature\n (2) Modifier une Candidature\n (3) Supprimer une Candidature"); + scanf("%d", &menugest1); + + if (menugest1 == 1) + //FONCTION INSERTION LISTE AVEC AFFICHAGE NOUVELLE LISTE + else if (menugest1 == 2) + //FONCTION MISE A JOUR LISTE AVEC AFFICHAGE NOUVELLE LISTE + else if (menugest1 == 3) + //FONCTION SUPPRESSION LISTE AVEC AFFICHAGE NOUVELLE LISTE + + } + else if (menu1 == 2){ + printf("") + + } + +} diff --git a/part2.don b/part2.don new file mode 100644 index 0000000..4ef487b --- /dev/null +++ b/part2.don @@ -0,0 +1,73 @@ +4 + +35 +Durand + +Jean Jacques + +15.75 12.25 9.5 17.00 + +3 + +Clermont-Ferrand +Informatique +0 +0 +Grenoble +Informatique +0 +0 +Aurillac +Bio-Informatique +0 +0 + +36 +Dupont + +Jeannine + +10.2 15.65 12.45 18.00 + +2 + +Clermont-Ferrand +Informatique +0 +0 +Aurillac +Informatique +0 +0 + +37 +Thérèse + +Francoise + +10.5 12.65 14.45 16.00 + +1 + +Clermont-Ferrand +Bio-Informatique +0 +0 + +38 +Henry + +Bertrand + +5.2 14.65 11.23 14.00 + +3 + +Clermont-Ferrand +Informatique +0 +0 +Aurillac +Informatique +0 +0