begin process at 2012 02 08 22:06:39
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Application

 > PROGRAMME QUI CALCUL LES VENTES TRIMESTRIELLES ...

PROGRAMME QUI CALCUL LES VENTES TRIMESTRIELLES ...


 Information sur la source

 Description



encodez au moins 3 produits  pour tester le prog (option 1) et livrez en au moins 3 (option 2)pour voir le resultat(option 3)

sinon je penserais à créer une page annexe pour afficher les produits + leurs id + leur prix et la tva avec une option "voir liste"

en attendant ...

Source

  • #include <stdio.h>
  • #include <stdlib.h>
  • #include <conio.h>
  • #include <ctype.h>
  • #include<dos.h>
  • struct produits
  • { int mois;
  • int n_piece;
  • } tprod[25];
  • struct pieces
  • {
  • char libelle[11];
  • long n_fourn;
  • int prix_htva;
  • int code;
  • } tpieces[300];
  • struct trime {
  • int n_pcs;
  • char libelle[11];
  • int prix;
  • int trim1;
  • int trim2;
  • int trim3;
  • int trim4;
  • int quantite;
  • } t_res[10];
  • int der=0;
  • int encode_pieces ()
  • {
  • clrscr();
  • printf("********* encodage de pieces ***************** \n");
  • getch();
  • der++;
  • { printf(" entrez libelle (10 caract max!!): \n");scanf("%s",tpieces[der].libelle);
  • tprod[der].n_piece=der;
  • printf(" nøfournisseur : \n");scanf("%d",&tpieces[der].n_fourn);
  • printf(" entrez prix : \n");scanf("%d",&tpieces[der].prix_htva);
  • printf(" entrez code tva : \n");scanf("%d",&tpieces[der].code);
  • clrscr();
  • }
  • { t_res[der].n_pcs=tprod[der].n_piece;
  • strcpy(t_res[der].libelle,tpieces[der].libelle);
  • t_res[der].prix=tpieces[der].prix_htva;
  • }
  • return 0;
  • }
  • int encode_prod ()
  • {
  • int mois=0;
  • int quant=0;
  • int ind=0;
  • clrscr();
  • printf(" ************* listing des courses *************** \n");
  • getch();
  • fflush(stdin);
  • { printf(" entrez le mois pour livraison svp [de 1 &#8230; 12 ]: \n");scanf("%d",&mois);
  • printf(" entrez le nøde la piece voulue ");scanf("%d",&ind);printf(" vous avez choisi un(e) %s \n",tpieces[ind].libelle);
  • printf(" quantit&#8218; : \n");scanf("%d",&quant);
  • t_res[ind].quantite+=quant;
  • clrscr();
  • if (mois>0 && mois<4) { t_res[ind].trim1+=(quant*tpieces[ind].prix_htva); }
  • else if (mois>3 && mois <7) { t_res[ind].trim2+=(quant*tpieces[ind].prix_htva);}
  • else if (mois>6 && mois <10) { t_res[ind].trim3+=(quant*tpieces[ind].prix_htva); }
  • else if (mois>9 && mois <13) { t_res[ind].trim3+=(quant*tpieces[ind].prix_htva);}
  • } /* boucle for */
  • return 0;
  • }
  • /* ************************************************************************ */
  • int charger ()
  • { int i=0;
  • int max;
  • clrscr();
  • fflush(stdin);
  • printf(" r&#8218;capitulatif des ventes trimestrielles \n");
  • printf(" -----------------------------------------------\n");
  • printf(" nø du produit libelle quantite prix \n");
  • printf(" ------------------------------------------------------\n");
  • for (i=1;i<der+1;i++)
  • { printf(" %d %s %d %d \n\n",t_res[i].n_pcs,t_res[i].libelle,t_res[i].quantite,t_res[i].prix);
  • }
  • printf("\n");
  • printf(" nø produit 1øtrim 2øtrim 3øtrim 4øtrim \n");
  • for(i=1;i<der+1;i++)
  • {
  • printf(" %d %s %d %d %d %d \n",t_res[i].n_pcs,t_res[i].libelle,t_res[i].trim1,t_res[i].trim2,t_res[i].trim3,t_res[i].trim4);
  • }
  • getch();
  • clrscr();
  • return 0;
  • }
  • int menu()
  • { char c=NULL;
  • struct time heure_actuelle;
  • gettime(&heure_actuelle);
  • clrscr();
  • textcolor(10);
  • puts(" ------------- MENU ENCODAGE ---------------\n\n\n");
  • printf(" horloge systeme : %d h %d min %d sec\n\n",heure_actuelle.ti_hour,heure_actuelle.ti_min,heure_actuelle.ti_sec);
  • while (c!='4')
  • {
  • printf(" encoder tableau des pieces [1] \n");
  • printf(" encoder tableau des produits [2] \n");
  • printf(" charger les resultats [3] \n");
  • printf(" quitter [4] \n");
  • c=toupper(getch());
  • switch (c)
  • { case '1': encode_pieces();break;
  • case '2':encode_prod(); break;
  • case '3': charger(); break;
  • };
  • }
  • clrscr();
  • return 0;
  • }
  • int main ()
  • { clrscr();
  • printf(" avant de commencer &#8230; encoder voil&#8230; quelques petits conseils :\n\n -encode au moins 3 produits \n -retiens les numeros des 3 produits et &#8230; quelles produits ils correspondent\n\n\n Voil&#8230; c tout, &#8230; toi de tester ...\n");
  • getch();
  • fflush(stdin);
  • textcolor(10);
  • menu();
  • return 0;
  • }
  • 
#include <stdio.h>
#include <stdlib.h>
#include <conio.h>
#include <ctype.h>
#include<dos.h>


struct produits
		{ int mois;
		  int n_piece;

		} tprod[25];

struct pieces
		{
		  char libelle[11];
		  long n_fourn;
		  int prix_htva;
		  int code;

		} tpieces[300];

struct trime {
	       int n_pcs;
	       char libelle[11];
	       int prix;
	       int trim1;
	       int trim2;
	       int trim3;
	       int trim4;
	       int quantite;
	     } t_res[10];
int der=0;

int encode_pieces ()

{

clrscr();

printf("********* encodage de pieces ***************** \n");
getch();
der++;

		    { printf(" entrez libelle (10 caract max!!): \n");scanf("%s",tpieces[der].libelle);
		      tprod[der].n_piece=der;
		      printf(" nøfournisseur : \n");scanf("%d",&tpieces[der].n_fourn);
		      printf(" entrez prix :   \n");scanf("%d",&tpieces[der].prix_htva);
		      printf(" entrez code tva :   \n");scanf("%d",&tpieces[der].code);
		      clrscr();
		     }


		 { t_res[der].n_pcs=tprod[der].n_piece;
		   strcpy(t_res[der].libelle,tpieces[der].libelle);
		   t_res[der].prix=tpieces[der].prix_htva;
		 }



return 0;

}

int encode_prod ()

{
  int mois=0;
  int quant=0;
  int ind=0;
  clrscr();

printf(" ************* listing des courses *************** \n");
getch();

fflush(stdin);


		  { printf(" entrez le mois pour livraison svp [de 1 &#8230; 12 ]: \n");scanf("%d",&mois);
		    printf(" entrez le nøde la piece voulue   ");scanf("%d",&ind);printf("  vous avez choisi un(e) %s \n",tpieces[ind].libelle);
		    printf(" quantit&#8218; : \n");scanf("%d",&quant);
		    t_res[ind].quantite+=quant;
		    clrscr();

if (mois>0 && mois<4) { t_res[ind].trim1+=(quant*tpieces[ind].prix_htva); }

else if (mois>3 && mois <7)  { t_res[ind].trim2+=(quant*tpieces[ind].prix_htva);}

else if (mois>6 && mois <10) { t_res[ind].trim3+=(quant*tpieces[ind].prix_htva); }

else if (mois>9 && mois <13) { t_res[ind].trim3+=(quant*tpieces[ind].prix_htva);}

		   }  /* boucle for */




return 0;

}
/* ************************************************************************ */

int charger ()

{ int i=0;
  int max;
  clrscr();



fflush(stdin);
printf("               r&#8218;capitulatif des ventes trimestrielles  \n");
printf("              -----------------------------------------------\n");
printf("                        nø du produit      libelle      quantite     prix \n");
printf("                       ------------------------------------------------------\n");

for (i=1;i<der+1;i++)

{ printf("                        %d                %s            %d          %d   \n\n",t_res[i].n_pcs,t_res[i].libelle,t_res[i].quantite,t_res[i].prix);

}

printf("\n");
printf(" nø    produit    1øtrim    2øtrim    3øtrim   4øtrim   \n");

for(i=1;i<der+1;i++)

{
printf(" %d    %s         %d         %d        %d       %d       \n",t_res[i].n_pcs,t_res[i].libelle,t_res[i].trim1,t_res[i].trim2,t_res[i].trim3,t_res[i].trim4);


}

getch();
clrscr();
return 0;

}

int menu()

{ char c=NULL;


  struct time heure_actuelle;
  gettime(&heure_actuelle);
  clrscr();

textcolor(10);
puts(" ------------- MENU ENCODAGE ---------------\n\n\n");

printf(" horloge systeme : %d h %d min %d sec\n\n",heure_actuelle.ti_hour,heure_actuelle.ti_min,heure_actuelle.ti_sec);

while (c!='4')
	    {
	      printf(" encoder tableau des pieces   [1] \n");
	      printf(" encoder tableau des produits [2] \n");
	      printf(" charger les resultats        [3] \n");
	      printf("         quitter              [4] \n");

	     c=toupper(getch());
switch (c)

	{ case '1': encode_pieces();break;
	  case '2':encode_prod(); break;
	  case '3': charger(); break;

	};

	 }
clrscr();

return 0;
}

int main ()

{  clrscr();

printf(" avant de commencer &#8230; encoder voil&#8230; quelques petits conseils :\n\n -encode au moins 3 produits \n -retiens les numeros des 3 produits et &#8230; quelles produits ils correspondent\n\n\n    Voil&#8230; c tout, &#8230; toi de tester ...\n");

getch();

fflush(stdin);
textcolor(10);
menu();

return 0;

}




 Sources du même auteur

LOTTO

 Sources de la même categorie

Source avec Zip Source avec une capture CONTACTS MANAGER par eapaceinfo
Source avec Zip Source avec une capture CONTACTES BOOK par mature
Source avec Zip Source avec une capture [C++/QT] SLIDEALWAYS, RÉALISEZ DES SLIDES POUR VOTRE SITE AV... par doderic
Source avec Zip Source avec une capture MAILLAGE 3D (VTK + QT) par ammoun007
Source avec Zip Source avec une capture CONVHTML : UN UTILITAIRE DE CONVERSION POUR FICHIERS HTML par pgl10

Commentaires et avis

Commentaire de credo le 01/06/2005 10:01:27

ta source est interessante mais elle manque de commentaires

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Février 2012
LMMJVSD
  12345
6789101112
13141516171819
20212223242526
272829    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 1,186 sec (4)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales