fix de divers bugs

doc
Louis GERMAIN 1 year ago
parent a80a957711
commit 884dcbaf75

@ -110,7 +110,7 @@ void displayClientList(int clientID[], float cagnotte[], int suspended[], int is
* @param tlog_basket: taille logique du panier
* @return Rien
*/
void display_basket(int basket_tab_ref[], int basket_qte[], float weight[], float volume[], float unitPrice[], float *cagnotte, int tlog, int tlog_basket)
void display_basket(int basket_tab_ref[], int basket_qte[], float weight[], float volume[], float unitPrice[], int tlog, int tlog_basket)
{
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;
@ -133,7 +133,6 @@ void display_basket(int basket_tab_ref[], int basket_qte[], float weight[], floa
printf("%d\t%d\t%f\t%f\t%f\t%f\t%f\t%f\t%f\n", basket_tab_ref[i], basket_qte[i], weight[i], volume[i], unitPrice[i], total_weight_line[i], total_volume_line[i], total_price_line[i],cagnotte_line[i]);
printf("\t\t\t\t\tPrix total à payer: %f\t euros\n", total_price);
printf("\t\t\t\t\tCagnotte totale: %f\t euros\n", *cagnotte);
//constraintExceeded( weightConstraint, volumeConstraint, *priceConstraint, *cagnotte, tabWeight[], tabVolume[], tabPrice[], tabItemRef[], tabBasketRef[], tabBasketQuantity[], tlogItem, int tlogBasket)

@ -25,7 +25,7 @@ void errorHandling(int error)
printf("[ERREUR] - La taille physique du tableau est dépassée.\n");
break;
case -3:
print("ERREUR] - Problème lors de la lecture d'un fichier.\n");
printf("ERREUR] - Problème lors de la lecture d'un fichier.\n");
break;
case -4:
printf("[ERREUR] - Problème lors de l'écriture d'un fichier.\n");

@ -52,11 +52,11 @@ void global(void)
+var cagnotte: tableau des cagnottes des clients
*/
// Déclaration des variables
int tLogArticle, tLogClient, choice, status, currentUser;
int tLogArticle, tLogClient, choice, status, currentUser, clientPassword;
int reference[tmaxArticles], clientID[tmaxClients], clientPassword[tmaxClients], suspended[tmaxClients], isAdmin[tmaxClients];
float weight[tmaxArticles], volume[tmaxArticles], unitPrice[tmaxArticles], cagnotte[tmaxClients];
// Chargement de toute les données
chargeDonnees(&tLogArticle, &tLogClient, reference, weight, volume, unitPrice, clientID, cagnotte, suspended, isAdmin);
chargeDonnees(&tLogArticle, &tLogClient, reference, weight, volume, unitPrice, clientID, clientPassword, cagnotte, suspended, isAdmin);
// Affichage du menu
choice = displayMenu();

@ -49,7 +49,7 @@ int searchTab(int targetTab[], int valSearched, int tLog, int *found);
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 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, int tlog, int tlog_basket);
void display_basket(int basket_tab_ref[], int basket_qte[], float weight[], float volume[], float unitPrice[], int tlog, int tlog_basket);
int reinit_basket(int tlog_basket);
int basket_del_article( int basket_tab_ref[], int basket_tab_qte[], int tlog_basket);

@ -156,7 +156,6 @@ int basket_add (int tab_reference[], float weight[], float volume[], float unitP
*cagnotte = *cagnotte + *cagnotte*0.10;
tlog_basket = tlog_basket+1;
display_basket( basket_tab_ref, basket_tab_qte, weight, volume, unitPrice, *cagnotte, tlog, tlog_basket);
return tlog_basket;
}

Loading…
Cancel
Save