diff --git a/app b/app index f78c293..0458afb 100755 Binary files a/app and b/app differ diff --git a/donnee/articles.txt b/donnee/articles.txt index a735975..6231299 100644 --- a/donnee/articles.txt +++ b/donnee/articles.txt @@ -2,4 +2,4 @@ 233 10.00 15.00 32.00 272 6.500 10.00 29.99 464 50.0 25.50 60.00 -958 4.75 60.00 32.00 \ No newline at end of file +958 4.75 60.00 32.00 diff --git a/src/app/core_logic/client.c b/src/app/core_logic/client.c index fc2280a..92a8936 100644 --- a/src/app/core_logic/client.c +++ b/src/app/core_logic/client.c @@ -141,7 +141,7 @@ void affiche_recap_panier(int panier[], int taillePanier, int references[], floa for (int i = 0; i < taillePanier; i++) { int reference = panier[i]; int articleIndex = -1; - for (int j = 0; j < taillePanier; j++) { + for (int j = 0; j < MAX_ARTICLES; j++) { if (references[j] == reference) { articleIndex = j; break; @@ -158,14 +158,13 @@ void affiche_recap_panier(int panier[], int taillePanier, int references[], floa float prixArticle = prixUnitaire[articleIndex]; int quantite = quantites[i]; - printf("%d\t %d\t %.2f\t %.2f\t %.2f\t %.2f\t %.2f\t %.2f\n", reference, quantite, poidsArticle, volumeArticle, - prixArticle, poidsArticle, volumeArticle, prixArticle); + prixArticle, poidsArticle * quantite, volumeArticle * quantite, prixArticle * quantite); - poidsTotal += poidsArticle; - volumeTotal += volumeArticle; - montantTotal += prixArticle; + poidsTotal += poidsArticle * quantite; + volumeTotal += volumeArticle * quantite; + montantTotal += prixArticle * quantite; } printf("Prix total à payer: %.2f euros\n", montantTotal); diff --git a/src/app/interface/interface_client.c b/src/app/interface/interface_client.c index 55ee3d5..6e63392 100644 --- a/src/app/interface/interface_client.c +++ b/src/app/interface/interface_client.c @@ -76,7 +76,7 @@ void global_client() { return; } - if (suspendus[indexClient] == 0) { + if (suspendus[indexClient] == 1) { printf("Le client est suspendu et ne peut pas utiliser l'application.\n"); return; }