diff --git a/src/display.c b/src/display.c index 2e25067..53548af 100644 --- a/src/display.c +++ b/src/display.c @@ -2,20 +2,6 @@ void displayItem(int tabReference[], float weight[], float volume[], float unitPrice[], int tlog) { - /* - Affichage des données d'un article choisi par sa référence sous forme: - référence poids volume prix - Avec la référence unique du produit, le poids du produit, le volume du produit et son prix à l'unité. - - +param tabReference: tableau des références des articles - +param weight: tableau des poids des articles - +param volume: tableau des volumes des articles - +param unitPrice: tableau des prix à l'unité des articles - +param tlog: taille logique des tableaux des articles - - +var reference: référence de l'article recherché - +var index: index de l'article recherché dans le tableau - */ int reference, index; printf("Entrez la référence de l'article cherché: "); scanf("%d", &reference); @@ -127,7 +113,6 @@ void displayClientList(int clientID[], float cagnotte[], int suspended[], int is * @return Rien */ 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; int i; diff --git a/src/exe b/src/exe new file mode 100644 index 0000000..91811c8 Binary files /dev/null and b/src/exe differ diff --git a/src/login.c b/src/login.c new file mode 100644 index 0000000..46015fa --- /dev/null +++ b/src/login.c @@ -0,0 +1 @@ +#include "main.h" diff --git a/src/main.h b/src/main.h index f4c767f..611c6ba 100644 --- a/src/main.h +++ b/src/main.h @@ -30,7 +30,7 @@ void inputItem(int tabReference[], float tabWeight[], float tabVolume[], float u void deleteItem(int tabReference[], float tabWeight[], float tabVolume[], float unitPrice[], int *tlog); //! AFFICHAGE DES DONNEES -void displayAItem(int reference[], float weight[], float volume[], float unitPrice[], int tlog); +void displayItem(int tabReference[], float weight[], float volume[], float unitPrice[], int tlog); void displayItemList(int reference[], float weight[], float volume[], float unitPrice[], int log); void displayClient(int clientID[], float cagnotte[], int suspended[], int isAdmin[], int tlog); void displayClientList(int clientID[], float cagnotte[], int suspended[], int isAdmin[], int tlog); diff --git a/src/panier.c b/src/panier.c index 2a5c0f6..8dfb8c0 100644 --- a/src/panier.c +++ b/src/panier.c @@ -51,6 +51,7 @@ 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; @@ -87,7 +88,8 @@ int constraintExceeded(float weightConstraint, float volumeConstraint, float *pr printf("Vous pouvez utiliser votre cagnotte, dont le montant est de %.2f, entrez le montant à utiliser ou -1 si vous voulez retirer un article: ", *cagnotte); scanf("%f", &cagnotteUse); if (cagnotteUse == -1) - return -1; + return -1; + while (cagnotteUse > *cagnotte || totalPrice-cagnotteUse > *priceConstraint) { if (cagnotteUse > *cagnotte)