Header Ads

test

Program for a distributor

c  2.jpgfd297392-1cb3-4b6d-9821-58c7b9bc862bLarge

   1: #include <iostream.h>



   2: #include <graphics.h>



   3: #include <dos.h>



   4: #include <conio.h>



   5: #include <stdlib.h>



   6: #include <stdio.h>



   7:  



   8:  



   9: class 



  10: {



  11:  



  12: private :



  13:     int z,P1,P2,P3,P4,P5,P6,P7,P8,totalP;



  14:     int S1,S2,S3,S4,S5,S6,S7,S8,S9,totalS;



  15:     int D1,D2,D3,D4,D5,D6,D7,D8,totalD;



  16:     int s1,s2,s3,s4,s5,s6,s7,s8,totals;



  17:     int p1,p2,p3,p4,p5,p6,p7,p8,totalp;



  18:  



  19: public :



  20:     void FRONT()



  21:   {



  22:     totals=totalp=totalP=totalS=0;



  23:     P1=P2=P3=P4=P5=P6=P7=P8=0;



  24:     S1=S2=S3=S4=S5=S6=S7=S8=0;



  25:     p1=p2=p3=p4=p5=p6=p7=p8=0;



  26:     s1=s2=s3=s4=s5=s6=s7=s8=0;



  27:     z=0;



  28:  



  29: //MAIN



  30: SCREEN********************************************************************



  31:  



  32: switching:



  33:  



  34:     {



  35:     int gdriver = DETECT, gmode;



  36:     initgraph(&gdriver, &gmode, "C:\TC\BGI");



  37:     cleardevice();



  38:     setcolor(getmaxcolor());



  39:     textcolor(getmaxcolor());



  40:     settextjustify(CENTER_TEXT, CENTER_TEXT);



  41:     settextstyle(10,0,4);



  42:     outtextxy(320,25,"ZINNIA DISTRIBUTOR");



  43:     setcolor(13);



  44:     rectangle(0,0,639,70);



  45:     rectangle(2,2,637,68);



  46:     rectangle(4,4,635,66);



  47:     rectangle(220,140,420,340);



  48:     rectangle(223,143,417,337);



  49:     gotoxy(33,12);



  50:     cout<<"1)  PURCHASE";



  51:     gotoxy(33,14);



  52:     cout<<"2)  SALES";



  53:     gotoxy(33,16);



  54:     cout<<"3)  REPORT";



  55:     gotoxy(33,18);



  56:     cout<<"4)  EXIT";



  57:     gotoxy(32,28);



  58:     cout<<"YOUR CHOICE IS : ";



  59:     rectangle(200,420,440,460);



  60:     rectangle(202,422,438,458);



  61:     setfillstyle(10,13);



  62:     floodfill(1,75,13);



  63:     cin>>z;



  64:     cleardevice();



  65:  



  66: switch(z)



  67:  



  68:       {



  69: case 1:



  70: //PURCHASE***************************************************************



  71:     {



  72:  



  73: cout<<"



  74: _________________________________________________________________



  75: _______________";



  76:     cout<<"



  77:  



  78:  SNO               ITEM                   RATE            QTY



  79: AMOUNT   ";



  80:  



  81: cout<<"



  82: _________________________________________________________________



  83: _______________";



  84:     cout<<"



  85:  



  86:  1]                WHOLE                   55      ";



  87:     cout<<"



  88:  



  89:  2]                PRE-CUT                 60      ";



  90:     cout<<"



  91:  



  92:  3]                ASSORTED                35      ";



  93:     cout<<"



  94:  



  95:  4]                SOUP                    10      ";



  96:     cout<<"



  97:  



  98:  5]                WINGS                   55      ";



  99:     cout<<"



 100:  



 101:  6]                GIZZARD                 45      ";



 102:     cout<<"



 103:  



 104:  7]                TWO LEGS                90      ";



 105:     cout<<"



 106:  



 107:  8]                FOUR DRUMS              30      ";



 108:  



 109: cout<<"



 110:  



 111: _______________________________________________________________



 112: _________________";



 113:     cout<<"



 114:  



 115:  



 116:                                                   TOTAL ----->     



 117: Rs.";



 118:  



 119: cout<<"



 120:  



 121: _______________________________________________________________



 122: _________________";



 123:     rectangle(0,0,639,479);



 124:     rectangle(530,400,635,440);



 125:     settextstyle(10,0,4);



 126:     outtextxy(210,410,"PURCHASE");



 127:     gotoxy(62,8);



 128:     cin>>P1;



 129:     p1=p1+P1;



 130:     gotoxy(62,10);



 131:     cin>>P2;



 132:     p2=p2+P2;



 133:     gotoxy(62,12);



 134:     cin>>P3;



 135:     p3=p3+P3;



 136:     gotoxy(62,14);



 137:     cin>>P4;



 138:     p4=p4+P4;



 139:     gotoxy(62,16);



 140:     cin>>P5;



 141:     p5=p5+P5;



 142:     gotoxy(62,18);



 143:     cin>>P6;



 144:     p6=p6+P6;



 145:     gotoxy(62,20);



 146:     cin>>P7;



 147:     p7=p7+P7;



 148:     gotoxy(62,22);



 149:     cin>>P8;



 150:     p8=p8+P8;



 151:     gotoxy(75,8);



 152:     D1=P1*55;



 153:     cout<<D1;



 154:     gotoxy(75,10);



 155:     D2=P2*60;



 156:     cout<<D2;



 157:     gotoxy(75,12);



 158:     D3=P3*35;



 159:     cout<<D3;



 160:     gotoxy(75,14);



 161:     D4=P4*10;



 162:     cout<<D4;



 163:     gotoxy(75,16);



 164:     D5=P5*55;



 165:     cout<<D5;



 166:     gotoxy(75,18);



 167:     D6=P6*45;



 168:     cout<<D6;



 169:     gotoxy(75,20);



 170:     D7=P7*90;



 171:     cout<<D7;



 172:     gotoxy(75,22);



 173:     D8=P8*30;



 174:     cout<<D8;



 175:     gotoxy(75,27);



 176:     totalP=D1+D2+D3+D4+D5+D6+D7+D8;



 177:     totalp=totalp+totalP;



 178:     cout<<totalP;



 179:     getch();



 180:     goto switching;



 181:     }



 182:  



 183: case 2:



 184: //SALES*******************************************************************



 185: **



 186:     {



 187:  



 188: cout<<"



 189: _________________________________________________________________



 190: _______________";



 191:     cout<<"



 192:  



 193:  SNO               ITEM                   RATE            QTY



 194: AMOUNT   ";



 195:  



 196: cout<<"



 197: _________________________________________________________________



 198: _______________";



 199:     cout<<"



 200:  



 201:  1]                WHOLE                   60      ";



 202:     cout<<"



 203:  



 204:  2]                PRE-CUT                 65      ";



 205:     cout<<"



 206:  



 207:  3]                ASSORTED                40      ";



 208:     cout<<"



 209:  



 210:  4]                SOUP                    15      ";



 211:     cout<<"



 212:  



 213:  5]                WINGS                   60      ";



 214:     cout<<"



 215:  



 216:  6]                GIZZARD                 50      ";



 217:     cout<<"



 218:  



 219:  7]                TWO LEGS                95      ";



 220:     cout<<"



 221:  



 222:  8]                FOUR DRUMS              35      ";



 223:  



 224: cout<<"



 225:  



 226: _______________________________________________________________



 227: _________________";



 228:     cout<<"



 229:  



 230:  



 231:                                                   TOTAL ----->     



 232: Rs.";



 233:  



 234: cout<<"



 235:  



 236: _______________________________________________________________



 237: _________________";



 238:     rectangle(0,0,639,479);



 239:     rectangle(530,400,635,440);



 240:     settextstyle(10,0,4);



 241:     outtextxy(210,410,"SALES");



 242:     gotoxy(62,8);



 243:     cin>>S1;



 244:     s1=s1+S1;



 245:     gotoxy(62,10);



 246:     cin>>S2;



 247:     s2=s2+S2;



 248:     gotoxy(62,12);



 249:     cin>>S3;



 250:     s3=s3+S3;



 251:     gotoxy(62,14);



 252:     cin>>S4;



 253:     s4=s4+S4;



 254:     gotoxy(62,16);



 255:     cin>>S5;



 256:     s5=s5+S5;



 257:     gotoxy(62,18);



 258:     cin>>S6;



 259:     s6=s6+S6;



 260:     gotoxy(62,20);



 261:     cin>>S7;



 262:     s7=s7+S7;



 263:     gotoxy(62,22);



 264:     cin>>S8;



 265:     s8=s8+S8;



 266:     gotoxy(75,8);



 267:     D1=S1*60;



 268:     cout<<D1;



 269:     gotoxy(75,10);



 270:     D2=S2*65;



 271:     cout<<D2;



 272:     gotoxy(75,12);



 273:     D3=S3*40;



 274:     cout<<D3;



 275:     gotoxy(75,14);



 276:     D4=S4*15;



 277:     cout<<D4;



 278:     gotoxy(75,16);



 279:     D5=S5*60;



 280:     cout<<D5;



 281:     gotoxy(75,18);



 282:     D6=S6*50;



 283:     cout<<D6;



 284:     gotoxy(75,20);



 285:     D7=S7*95;



 286:     cout<<D7;



 287:     gotoxy(75,22);



 288:     D8=S8*35;



 289:     cout<<D8;



 290:     gotoxy(75,27);



 291:     totalS=D1+D2+D3+D4+D5+D6+D7+D8;



 292:     totals=totals+totalS;



 293:     cout<<totalS;



 294:     getch();



 295:     cleardevice();



 296:     goto switching;



 297:     }



 298:  



 299: case 3:



 300: //REPORT******************************************************************



 301: *



 302:     {



 303:  



 304: cout<<"___________________________________________________________________



 305: _____________";



 306:     cout<<"



 307:  SNO                ITEM             PURCHASE         SALES



 308: STOCK LEFT";



 309:  



 310: cout<<"



 311: _________________________________________________________________



 312: _______________";



 313:     cout<<"



 314:  1]                WHOLE        "<<p1<<"        "<<s1<<"        "<<p1-s1;



 315:     cout<<"



 316:  2]                



 317: PRE-CUT        "<<p2<<"        "<<s2<<"        "<<p2-s2;



 318:     cout<<"



 319:  3]                



 320: ASSORTED        "<<p3<<"        "<<s3<<"        "<<p3-s3;



 321:     cout<<"



 322:  4]                



 323: SOUP            "<<p4<<"        "<<s4<<"        "<<p4-s4;



 324:     cout<<"



 325:  5]                WINGS        "<<p5<<"        "<<s5<<"        "<<p5-s5;



 326:     cout<<"



 327:  6]                



 328: GIZZARD        "<<p6<<"        "<<s6<<"        "<<p6-s6;



 329:     cout<<"



 330:  7]                TWO 



 331: LEGS        "<<p7<<"        "<<s7<<"        "<<p7-s7;



 332:     cout<<"



 333:  8]                FOUR



 334: DRUMS        "<<p8<<"        "<<s8<<"        "<<p8-s8;



 335:  



 336: cout<<"



 337: _________________________________________________________________



 338: _______________";



 339:     cout<<"



 340:  



 341:  



 342:     PURCHASE           : Rs."<<totalp;



 343:     cout<<"



 344:  



 345:     SALES              : Rs."<<totals;



 346:     cout<<"



 347:  



 348:     PROFIT             : Rs."<<(s1+s2+s3+s4+s5+s6+s7+s8)*5;



 349:     cout<<"



 350:  



 351:  



 352:     BALANCE ON COUNTER : Rs. ";



 353:     if((totals-totalp)<0)



 354:       {



 355:       cout<<-(totals-totalp)<<" CREDIT



 356:  



 357: ";



 358:       }



 359:     else



 360:       {



 361:       cout<<(totals-totalp)<<" DEBIT



 362:  



 363: ";



 364:       }



 365:     rectangle(0,0,639,479);



 366:     rectangle(50,300,370,470);



 367:     rectangle(55,425,365,455);



 368:     rectangle(52,302,368,468);



 369:     settextstyle(10,0,4);



 370:     outtextxy(320,20,"REPORT");



 371:     getch();



 372:     cleardevice();



 373:     goto switching;



 374:     }



 375:  



 376: case 4:



 377: //EXIT THE



 378: PROGRAM******************************************************************



 379:     {



 380:     exit(0);



 381:     }



 382:  



 383: default :



 384: //DEFAULT*****************************************************************



 385: *



 386:     {



 387:     goto switching;



 388:     }



 389:       }



 390:     }



 391:   }



 392: };



 393:  



 394:  



 395: //MAIN



 396: PROGRAM******************************************************************



 397:  



 398: void main()



 399: {



 400: clrscr();



 401: SHOP a;



 402: a.FRONT();



 403: getch();



 404: }


No comments

please write your mail id for contact: