Correction d'erreurs de compilation

doc
Rémi LAVERGNE 1 year ago
parent c729d548cc
commit a1bbc0408b
No known key found for this signature in database
GPG Key ID: 8861D8A4AD21A032

@ -2,7 +2,7 @@
void displayItem(int tabReference[], float weight[], float volume[], float unitPrice[], int tlog)
{
int reference, index;
int reference, index, found;
printf("Entrez la référence de l'article cherché: ");
scanf("%d", &reference);
while (reference < 0)
@ -10,7 +10,7 @@ void displayItem(int tabReference[], float weight[], float volume[], float unitP
printf("Erreur, la référence doit être positive, entrez la référence de l'article cherché: ");
scanf("%d", &reference);
}
index = recherche(reference, tabReference, tlog);
index = searchTab(tabReference, reference, tlog, &found);
if (index == -1)
{
printf("La référence cherchée n'existe pas");
@ -58,7 +58,7 @@ void displayClient(int clientID[], float cagnotte[], int suspended[], int isAdmi
+var id: identifiant du client recherché
+var index: index de l'article recherché dans le tableau
*/
int id, index;
int id, index, found;
printf("Entrez le numéro du client cherché: ");
scanf("%d", &id);
while (id < 0)
@ -66,7 +66,7 @@ void displayClient(int clientID[], float cagnotte[], int suspended[], int isAdmi
printf("Erreur, le numéro du client doit être positif, entrez le numéro du client cherché: ");
scanf("%d", &id);
}
index = recherche(id, clientID, tlog);
index = searchTab(clientID, id, tlog, &found);
if (index == -1)
{
printf("Le client cherché n'existe pas");
@ -114,7 +114,7 @@ void displayClientList(int clientID[], float cagnotte[], int suspended[], int is
*/
void display_basket(int basket_tab_ref[], int basket_qte[], float weight[], float volume[], float unitPrice[], float *cagnotte,float weight_constraint, float volume_constraint, int tlog, int tlog_basket)
{
float total_weight_line[], total_volume_line[], total_price_line[], cagnotte_line[], total_weight, total_volume, total_price;
float total_weight_line[tlog_basket], total_volume_line[tlog_basket], total_price_line[tlog_basket], cagnotte_line[tlog_basket], total_weight, total_volume, total_price;
int i;
for (i=0; i<tlog_basket; i++)
{

@ -36,11 +36,11 @@ void displayClient(int clientID[], float cagnotte[], int suspended[], int isAdmi
void displayClientList(int clientID[], float cagnotte[], int suspended[], int isAdmin[], int tlog);
//! RECHERCHE
int recherche(int val, int tab[], int tlog);
int searchTab(int targetTab[], int valSearched, int tLog, int *found);
//! PANIER
void clientConstraint(float *weight, float *volume, float *price);
int constraintExceeded(float weightConstraint, float volumeConstraint, float *priceConstraint, float *cagnotte, float tabWeight[], float tabVolume[], float tabPrice[], int tabItemRef[], int tabBasketRef[], int tabBasketQuantity[], int tlogItem, int tlogBasket)
int constraintExceeded(float weightConstraint, float volumeConstraint, float *priceConstraint, float *cagnotte, float tabWeight[], float tabVolume[], float tabPrice[], int tabItemRef[], int tabBasketRef[], int tabBasketQuantity[], int tlogItem, int tlogBasket);
int basket_add (int tab_reference[], float weight[], float volume[], float unitPrice[], float *cagnotte, int basket_tab_ref[], int basket_tab_qte[],int tlog, int tlog_basket);
void display_basket(int basket_tab_ref[], int basket_qte[], float weight[], float volume[], float unitPrice[], float *cagnotte,float weight_constraint, float volume_constraint, int tlog, int tlog_basket);
int reinit_basket(int tlog_basket);

@ -46,7 +46,7 @@ void modifyClient(int clientID[], float cagnotte[], int suspended[], int isAdmin
+var montant: montant à ajouter à la cagnotte
+var modif: modification à exécuter sur le client
*/
int index, numClient;
int index, numClient, found;
float montant;
char modif;
printf("Entrez le numéro du client dont vous voulez modifier les données: ");
@ -56,12 +56,12 @@ void modifyClient(int clientID[], float cagnotte[], int suspended[], int isAdmin
printf("Erreur, le numéro du client doit être positif, entrez le numéro du client ou 0 si vous souhaitez arrêter la saisie: ");
scanf("%d%*c", &numClient);
}
index = recherche(numClient, clientID, tlog);
index = searchTab(clientID, numClient, tlog, &found);
while (index == -1)
{
printf("Cet identifiant client n'existe pas, réessayer ou tapez 0 si vous souhaitez arrêter la saisie: ");
scanf("%d%*c", &numClient);
index = recherche(numClient, clientID, tlog);
index = searchTab(clientID, numClient, tlog, &found);
}
printf("Entrez la modification voulue (s pour suspendre ou réactiver, c pour ajouter à la cagnotte, a pour activer ou désactiver les droits administrateurs): ");
scanf("%c%*c", &modif);
@ -150,7 +150,7 @@ void inputItem(int tabReference[], float tabWeight[], float tabVolume[], float u
void deleteItem(int tabReference[], float tabWeight[], float tabVolume[], float unitPrice[], int *tlog)
{
int reference = -1, index, i;
int reference = -1, index, i, found;
while (reference != 0)
{
printf("Entrez la référence du produit à supprimer ou 0 si vous souhaitez arrêter la saisie: ");
@ -160,12 +160,12 @@ void deleteItem(int tabReference[], float tabWeight[], float tabVolume[], float
printf("Erreur: la référence doit être positive, entrez la référence du produit ou 0 si vous souhaitez arrêter la saisie: ");
scanf("%d", &reference);
}
index = recherche(reference, tabReference, *tlog);
index = searchTab(tabReference, reference, *tlog, &found);
while (index == -1)
{
printf("Cette référence n'existe pas, réessayer ou tapez 0 si vous souhaitez arrêter la saisie: ");
scanf("%d", &reference);
index = recherche(reference, tabReference, *tlog);
index = searchTab(tabReference, reference, *tlog, &found);
}
for (i=*tlog; i>index; i--)
{
@ -180,7 +180,7 @@ void deleteItem(int tabReference[], float tabWeight[], float tabVolume[], float
void deleteClient(int clientID[], float cagnotte[], int suspended[], int isAdmin[], int *tlog)
{
int numClient = -1, index, i;
int numClient = -1, index, i, found;
while (numClient != 0)
{
printf("Entrez l'identifiant du client à supprimer ou 0 si vous souhaitez arrêter la saisie: ");
@ -190,12 +190,12 @@ void deleteClient(int clientID[], float cagnotte[], int suspended[], int isAdmin
printf("Erreur, le numéro du client doit être positif, entrez le numéro du client ou 0 si vous souhaitez arrêter la saisie: ");
scanf("%d", &numClient);
}
index = recherche(numClient, clientID, *tlog);
index = searchTab(clientID, numClient, *tlog, &found);
while (index == -1)
{
printf("Cet identifiant client n'existe pas, réessayer ou tapez 0 si vous souhaitez arrêter la saisie: ");
scanf("%d", &numClient);
index = recherche(numClient, clientID, *tlog);
index = searchTab(clientID, numClient, *tlog, &found);
}
for (i=*tlog; i>index; i--)
{

@ -51,7 +51,6 @@ void clientConstraint(float *weight, float *volume, float *price)
* @return an integer value.
*/
// TODO réécrire cette documentation
//! ERREUR à corriger !!
int constraintExceeded(float weightConstraint, float volumeConstraint, float *priceConstraint, float *cagnotte, float tabWeight[], float tabVolume[], float tabPrice[], int tabItemRef[], int tabBasketRef[], int tabBasketQuantity[], int tlogItem, int tlogBasket)
{
int index, found, i;
@ -125,7 +124,7 @@ int constraintExceeded(float weightConstraint, float volumeConstraint, float *pr
int basket_add (int tab_reference[], float weight[], float volume[], float unitPrice[], float *cagnotte, int basket_tab_ref[], int basket_tab_qte[],int tlog, int tlog_basket)
{
int ref_to_add, qte_to_add, trouve, index_ajout, i;
float total_weight[], total_volume[], total_price[], total_cagnotte[];
float total_weight[tlog_basket], total_volume[tlog_basket], total_price[tlog_basket], total_cagnotte[tlog_basket];
printf("Quelle référence souhaitez-vous ajouter au panier?");
scanf("%d", &ref_to_add);
index_ajout = searchTab(tab_reference, ref_to_add, tlog, &trouve);
@ -148,14 +147,15 @@ int basket_add (int tab_reference[], float weight[], float volume[], float unitP
index_ajout = basket_tab_ref[i];
total_weight[i] = total_weight + weight[index_ajout]*qte_to_add;
total_volume[i] = total_volume + volume[index_ajout]*qte_to_add;
total_price[i] = total_price + unitPrice[index_ajout]*qte_to_add;
total_weight[i] += weight[index_ajout]*qte_to_add;
total_volume[i] += volume[index_ajout]*qte_to_add;
total_price[i] += unitPrice[index_ajout]*qte_to_add;
*cagnotte = *cagnotte + *cagnotte*0.10;
tlog_basket = tlog_basket+1;
display_basket( basket_tab_ref[], basket_tab_qte[], weight[], volume[], unitPrice[], *cagnotte, weight_constraint, volume_constraint, tlog, tlog_basket);
//! A corriger
//display_basket(basket_tab_ref, basket_tab_qte, weight, volume, unitPrice, *cagnotte, weight_constraint, volume_constraint, tlog, tlog_basket);
return tlog_basket;
}

Loading…
Cancel
Save