Louis GERMAIN 1 year ago
commit 98aa6faa23

@ -1,7 +1,45 @@
# SAE 1.01 - Implémentation d'un besoin client
=====================================
SAÉ 1.01 - Implémentation d'un besoin client
=====================================
__1A - Groupe 7/8:__
- Rémi LAVERGNE
- Julien ABADIE
- Louis GERMAIN
Par:
Rémi LAVERGNE - Julien ABADIE - Louis GERMAIN
Groupe 7/8 - 1A 2023-2024
**Répartition du Travail**
-----------------------
Rémi LAVERGNE : /
Louis GERMAIN : /
Julien ABADIE : /
**Composition des fichiers sources**
--------------------------------
- *main.c* >> Juste la fonction main, se lançant lors de l'exécution du programme.
- *main.h* >> Tous les prototypes des fonctions réalisées, ainsi que les inclusions de module et déclaration de constantes.
- *articles.txt* >> Fichier texte composé de x colonnes,
- *clients.txt* >> Fichier texte composé de x colonnes dans l'ordre qui suit :
identifiant | mot de passe | cagnotte | suspendu (0=actif ; 1=suspendu) | rôle (0=client ; 1=administrateur)
**Fonctionnement**
------------
Jeu de données
==============
articles.txt
```
/
```
clients.txt
```
/
```

@ -48,7 +48,6 @@ int chargeArticles(int reference[], float weight[], float volume[], float unitPr
if(article==NULL)
{
errorHandling(-4);
exit(1);
}
int ref, tL=0;
@ -98,8 +97,7 @@ int chargeClients(int clientID[], int clientPassword[], float cagnotte[], int su
client = fopen("clients.txt","r");
if(client==NULL)
{
printf("ERREUR: Echec de l'ouverture en lecture de 'clients.txt'.\n");
exit(1);
errorHandling(-4);
}
int id, passwd, sus, tL=0, adm;
@ -110,7 +108,7 @@ int chargeClients(int clientID[], int clientPassword[], float cagnotte[], int su
{
if(tL == tmaxArticles)
{
printf("Tableau trop petit.\n");
errorHandling(-3);
return tL;
}
@ -166,14 +164,10 @@ void sauvegardeArticles(int reference[], float weight[], float volume[], float u
article = fopen("articles.txt","w");
if(article==NULL)
{
printf("ERREUR: Echec de l'ouverture en écriture de 'articles.txt'.\n");
exit(1);
errorHandling(-5);
}
int i;
for(i=0; i<tLogArticle; i++)
{
fprintf(article, "%d %f %f %f\n", reference[i], weight[i], volume[i], unitPrice[i]);
printf("ERREUR: Echec de l'ouverture en écriture de 'clients.txt'.\n");
exit(1);%f\n", reference[i], weight[i], volume[i], unitPrice[i]);
}
fclose(article);
@ -196,8 +190,7 @@ void sauvegardeClients(int clientID[], int clientPassword[], float cagnotte[], i
client = fopen("clients.txt","w");
if(client==NULL)
{
printf("ERREUR: Echec de l'ouverture en écriture de 'clients.txt'.\n");
exit(1);
errorHandling(-5);
}
int i;

Loading…
Cancel
Save