création du menu et divers fonctions sur la partie 2 algo

master
Roxane ROSSETTO 2 years ago
parent daa124b1f7
commit dfd9c9b959

@ -32,8 +32,10 @@ Candidat lireCandidat(void)//fonction qui lit un candidat sur le clavier
scanf("%d%*c", &c.nEtu); scanf("%d%*c", &c.nEtu);
printf("Nom du candidat :\n"); printf("Nom du candidat :\n");
fgets(c.nom, 20, stdin); fgets(c.nom, 20, stdin);
c.nom[strlen(c.nom)-1]= '\0';
printf("Prénom du candidat :\n"); printf("Prénom du candidat :\n");
fgets(c.prenom, 20, stdin); fgets(c.prenom, 20, stdin);
c.prenom[strlen(c.prenom)-1]= '\0';
printf("Moyenne de maths :\n"); printf("Moyenne de maths :\n");
scanf("%f", &c.moymat); scanf("%f", &c.moymat);
printf("Moyenne de français :\n"); 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 ########################################## ######################################### 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("")
}
}

@ -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
Loading…
Cancel
Save