From efe61267a11706e385363f24100df1a4747bf67e Mon Sep 17 00:00:00 2001 From: Nicolas BLONDEAU Date: Thu, 5 Jan 2023 08:38:46 +0100 Subject: [PATCH] Modification de iut.h -> Ajout de fonctions pour la partie utilisateur, et nouvelles fonctions pour utilisateurIut.c --- iut.h | 4 ++-- utilisateurIut.c | 45 +++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+), 2 deletions(-) diff --git a/iut.h b/iut.h index 9c79bd9..feb1eeb 100644 --- a/iut.h +++ b/iut.h @@ -18,8 +18,8 @@ typedef struct{ typedef enum {faux,vrai}Booleen; //Menu utilisateur : - //void MenuUtilisateur(fdhsjklfhdsjklfhdjskl); - + void MenuUtilisateur(VilleIUT *tiut[],int n); + int rechercheIUT(VilleIUT *tiut[]); //Menu administrateur : void MenuAdministrateur(VilleIUT *tiut[],int n); diff --git a/utilisateurIut.c b/utilisateurIut.c index 53c5fdf..0457fb3 100644 --- a/utilisateurIut.c +++ b/utilisateurIut.c @@ -1 +1,46 @@ #include +#include +#include +#include "iut.h" + +void MenuUtilisateur(VilleIUT *tiut[],int n){ + int choix, succes; + printf("\n1 - Recherche d'un IUT\n2 - Départements dans chaque IUT\n3 - Nombre de places en première année\n4 - Recherche d'un département\n5 - Quitter"); + scanf("%d%*c",&choix); + if(choix==1){ + //Recherche de tel IUT + succes = rechercheIUT(tiut); + } + if(choix==2){ + //creer departemement + /*printf("\ndepartement :"); + scanf("%s",departement); + printf("\nnombre de place :"); + scanf("%d",&nbp); + printf("\nresponsable :"); + scanf("%s",respon);*/ + //V=Enfiler(V,departement,nbp,respon); + } + if(choix==3){ + // + } + if(choix==4){ + // + } + if(choix==5){ + return; + } +} + +int rechercheIUT(VilleIUT *tiut[]){ + char rech[31]; + printf("Entrez le nom d'une ville ou d'un IUT : "); + scanf("%s", &rech); + if(rech==NULL){ + printf("NOPE"); + exit(1); + } + else + printf("Succès"); + return 25; +}