#include "FonctionsClient.h" #include "FonctionsResponsable.h" #include #include /** *\file FonctionsClient.c *\brief fichier.c qui contient toutes les fonctions concernant le client. *\author BARDET Ange & Mathis CHIRAT *\date 20 oct 2023 */ float initVoiture(float *chargeV) { float volV; printf("Quel est le volume (L) du coffre de votre véhicule : "); scanf("%f",&volV); while (volV < 0) { printf("Erreur ; Le volume doit être positif ; retapez : "); scanf("%f",&volV); } printf("Quel est la charge totale de votre véhicule (Kg) : "); scanf("%f",chargeV); while (*chargeV < 0) { printf("Erreur ; La charge doit être positive ; retapez : "); scanf("%f",chargeV); } return volV; } int ajoutPanier(int TrefC[],int TquanC[],int nArticle,int Tref[], int n) { int refP,code,quantite,pos; printf("Saisir la référence du produit à ajouter au panier: "); scanf("%d",&refP); pos = posRefC(TrefC,n,refP,nArticle,Tref); if (pos != -1) { printf("L'article existe déja dans le panier."); return nArticle; } code = posRef(Tref,refP,n); while (code == -1) { printf("Erreur ; Cette référence n'existe pas dans la base de donnée; retapez : "); scanf("%d",&refP); code = posRef(Tref,refP,n); } printf("Saisir la quantité souhaité pour le produit: "); scanf("%d",&quantite); while (quantite < 1) { printf("Erreur ; La quantité peut seulement être positive; retapez : "); scanf("%d",&quantite); } printf("\nRéférence : %d\n",refP); printf("Quantité : %d\n",quantite); TrefC[nArticle] = refP; TquanC[nArticle] = quantite; return nArticle +=1; } void affichPanier(int TrefC[],int TquanC[],int nArticle,int Tref[], float Tpoid[],float Tvolume[],float Tprix[],float chargeV, float volV,int n) { printf("\nRéf\tQté\tPoids\tVol\tPrixU\tPoidsTot\tVolTot\tPrixTot\tCagnotte\n"); int i, pos,cagnotte; float prixtot,volR,chargeR; int cfinal=0; float prixfinal=0,volfinal=0,chargefinal=0; for (i=0;i