correction erreur de syntaxe SAE.c et fonction de bas réalisé SAEl.c

master
Alexis LAURENT 2 years ago
parent aa19f5eac5
commit 33a34bcc53

50
SAE.c

@ -36,7 +36,7 @@ bool verifQuit(void)
return true;
if (strcmp(choix,"non")==0)
return false;
printf("Erreur de sélection ! Veillez réessayer \n")
printf("Erreur de sélection ! Veuillez réessayer \n");
}
}
@ -51,7 +51,7 @@ bool verifSelection(void)
return true;
if (strcmp(choix,"non")==0)
return false;
printf("Erreur de sélection ! Veillez réessayer \n")
printf("Erreur de sélection ! Veuillez réessayer \n");
}
}
@ -65,7 +65,7 @@ bool confirmationSup(void)
return true;
if (strcmp(choix,"non")==0)
return false;
printf("Erreur de sélection ! Veillez réessayer \n")
printf("Erreur de sélection ! Veuillez réessayer \n");
}
@ -160,11 +160,9 @@ int gestionMenuAdmin(void)
system("clear");
switch(choix){
case 1:
AffichageVille(tiut, nbEle);
clearpage();
break;
case 2:
AffichageGlobalDepVille(tiut, nbEle);
clearpage();
break;
case 3:
@ -204,9 +202,9 @@ void AffichageVille(VilleIUT **tiut, int nbEle)
{
int i;
printf("\tIUT par ville :");
for(i=0,i<nbEle;i = i + 1)
for(i=0;i<nbEle;i++)
{
printf("- %s\n",tab[i]->ville);
printf("- %s\n",tiut[i]->ville);
}
}
@ -214,13 +212,13 @@ void AffichageGlobalDepVille(VilleIUT **tiut, int nbEle)
{
int i;
printf("\tDépartement par IUT :\n");
for(i=0,i<nbEle;i = i + 1)
for(i=0;i<nbEle;i++)
{
printf("- %s :\n\t",tiut[i]->ville);
while(tiut->idDept != NULL)
while(tiut[i]->idDept != NULL)
{
printf("|%s|\n",tiut->idDept->departement);
tiut->idDept = tiut->idDept->suiv;
printf("|%s|\n",tiut[i]->idDept->departement);
tiut[i]->idDept = tiut[i]->idDept->suiv;
}
}
}
@ -252,8 +250,8 @@ int rechVille(VilleIUT **tiut, int nbEle, char code[], int *trouve)
void AffichageNbplaceDeptVille(VilleIUT **tiut, int nbEle)
{
ListeDept *aux;
aux =(ListeDept *)malloc(sizeof(ListeDept));
MaillonDept *aux;
aux =(MaillonDept *)malloc(sizeof(MaillonDept));
char code[30];
int pos,trouve = 0;
while(1)
@ -293,7 +291,7 @@ void AffichageNbplaceDeptVille(VilleIUT **tiut, int nbEle)
free(aux);
}
void AffichageGlobalDepVille(VilleIUT **tiut, int nbEle)
void AffichageDepVille(VilleIUT **tiut, int nbEle)
{
char code[30];
int pos,trouve = 0;
@ -302,7 +300,6 @@ void AffichageGlobalDepVille(VilleIUT **tiut, int nbEle)
printf("IUT : ");
scanf("%s",code);
pos = rechVille(tiut, nbEle, code,&trouve);
aux = tiut[pos]->idDept;
if (trouve == 1)
{
printf("%s :\n\t",tiut[pos]->ville);
@ -313,13 +310,12 @@ void AffichageGlobalDepVille(VilleIUT **tiut, int nbEle)
if(!verifSelection())
break;
}
free(aux)
}
void AffichageDeptVille(VilleIUT **tiut, int nbEle)
{
ListeDept *aux;
aux =(ListeDept *)malloc(sizeof(ListeDept));
MaillonDept *aux;
aux =(MaillonDept *)malloc(sizeof(MaillonDept));
char code[30];
int pos = 0, nbocc = 0;
while(1)
@ -334,7 +330,7 @@ void AffichageDeptVille(VilleIUT **tiut, int nbEle)
{
if(strcmp(aux->departement, code)==0)
{
affichageListeDept(aux)
affichageListeDept(aux);
nbocc = nbocc + 1;
break;
}
@ -353,7 +349,7 @@ void AffichageGlobalIUT(VilleIUT **tiut, int nbEle)
int pos = 0;
while(pos < nbEle)
{
printf("Ville : %s\n",tiut[pos]->Ville);
printf("Ville : %s\n",tiut[pos]->ville);
affichageListeDept(tiut[pos]->idDept);
pos = pos + 1;
printf("\n");
@ -362,8 +358,8 @@ void AffichageGlobalIUT(VilleIUT **tiut, int nbEle)
void MiseAJourNbPlace(VilleIUT **tiut, int nbEle)
{
ListeDept *aux;
aux =(ListeDept *)malloc(sizeof(ListeDept));
MaillonDept *aux;
aux =(MaillonDept *)malloc(sizeof(MaillonDept));
int nouvNbPlace, pos, trouve;
char code[30];
while(1)
@ -426,7 +422,7 @@ void creationDept(VilleIUT **tiut, int nbEle)
nom[strlen(nom)-1] = "\0";
printf("Nombre de place du Département %s : ",code);
scanf("%d", nbP);
tiut[pos]->idDept = inserer(tiut[pos]->idDept,code,nom,nbP)
tiut[pos]->idDept = inserer(tiut[pos]->idDept,code,nom,nbP);
printf("insertion du département %s effectuer \n", code);
if (!verifSelection())
break;
@ -456,7 +452,7 @@ void suppressionDept(VilleIUT **tiut, int nbEle)
scanf("%s", code);
if (recherche(tiut[pos]->idDept, code))
if (confirmationSup())
tiut->idDept = supprimer(tiut->idDept, code);
tiut[pos]->idDept = supprimer(tiut[pos]->idDept, code);
if (!recherche(tiut[pos]->idDept, code))
printf("Ce Département n'existe pas dans l'IUT de %s \n",tiut[pos]->ville);
if (!verifSelection())
@ -487,12 +483,12 @@ void modifChefDept(VilleIUT **tiut, int nbEle)
{
if(strcmp(tiut[pos]->idDept->departement, code) == 1)
{
printf("Nom de l'ancien chef de département %s de %s : %s\n",tiut[pos]->idDept->departement, tiut[pos]->ville,tiut[pos]->idDept->resp);
printf("Nom de l'ancien chef de département %s de %s : %s\n",tiut[pos]->idDept->departement, tiut[pos]->ville,tiut[pos]->idDept->responsable);
printf("nom du nouveau chef de département %s de %s :",tiut[pos]->idDept->departement, tiut[pos]->ville);
fgets(code,30,stdin);
code[strlen(code)-1] = "\0";
tiut[pos]->idDept->resp = code;
printf("Chef de département : %s\n",tiut[pos]->idDept->resp);
strcpy(code, tiut[pos]->idDept->responsable);
printf("Chef de département : %s\n",tiut[pos]->idDept->responsable);
}
}
}

Loading…
Cancel
Save