#include<stdio.h>
#include<conio.h>
#include<string.h>
struct
customer
{
char
name[20];
char
nam[20];
float pri,w,count;
int
brand,p;
}brand1;
main()
{
long
int x;
clrscr();
printf("-------------------------------------------------------------------------------");
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\tTO
START PROGRAM PRESS =10802148");
printf("\n\n\n\n\n\n\n\n\n\n\n\n\n ENTER THE PASSWORD =
");
scanf("%ld",&x);
if(x==10802148)
{
karan();
}
else
{
printf("ENTER
the righit password");
}
return
1;
}
karan()
{
FILE
*sp;
int
a,i,d,p,e,k,kk,kkk,kkkk,kkkkk,kkkkkk,kkkkkkk;
long
int x;
char
ch,wh,qh,eh,rh,th,uh,oh,yh,nh,h;
clrscr();
printf("\n------------------------------------------------------------------------------");
printf("\n WEL COME YOU IN BAWEJA
TRADERS COMPANY ");
printf("\n YOU ARE LUCKY BECAUSE
YOU ARE HERE");
printf("\n--------******----------------------------------------------------******--------");
printf("\n
");
printf("\n
");
printf("\n
");
printf("\n
");
printf("\n ENTRER YOUR CHOICE FOR
WANDRING IN THIS COMPANY");
printf("\n*******************************************************************************");
printf("\n1.
ADD THE CUSTOMER
");
printf("\n2.
CUSTOMER LIST ");
printf("\n3.
BRAND OF CANDY'S ");
printf("\n4.
BRAND OF CHOCALATE
");
printf("\n5.
BRAND OF COOKIES
");
printf("\n6.
BRAND OF COLD DRINKS
");
printf("\n7.
BRAND OF SNACKS ");
printf("\n8.
BRAND OF GIFT PACK");
printf("\n9.
BIll");
printf("\n10.RECORD
OF BILLS THAT HAS CUT");
printf("\n11.
EXIT");
printf("
\n ENTER YOUR
CHOICE:=");
scanf("%d",&a);
switch(a)
{
case
1:
clrscr();
printf("\n----------------------------------------------------------------------------");
printf("\n ENTER THE CUSOMER FOR
RECORD");
printf("\n----------------------------------------------------------------------------");
sp=fopen("karan0.txt","a+");
printf("\nENTER
THE CUSTOMER NAME=");
scanf("%s",&brand1.name);
printf("\nENTER
THE BRAND NAME=");
scanf("%s",&brand1.nam);
printf("\nENTER
THE PRICE OF BRAND NAME=");
scanf("%f",&brand1.pri);
fprintf(sp,"\n %s
%s
%f",brand1.name,brand1.nam,brand1.pri);
fclose(sp);
printf("\nPRESS
1 KEY FOR GO IN MAIN MAIN MENU=");
scanf("%d",&e);
if(e==1)
{
karan();
}
break;
case
2:
clrscr();
printf("\n----------------------------------------------------------------------");
printf("\n********* CUSTOMERS OF BAWEJA TRADERS COMPANY ***********
");
printf("\n----------------------------------------------------------------------");
sp=fopen("karan0.txt","r");
while(nh!=EOF)
{
nh=fgetc(sp);
printf("%c",nh);
}
printf("\n PRESS 1 KEY FOR GO IN MAIN MAIN
MENU=");
printf("\n
**********************FOR EXIT PRESS ANY KEY*************= ");
scanf("%d",&e);
if(e==1)
karan();
else
exit();
fclose(sp);
break;
case
9:
clrscr();
sp=fopen("karan2.dat","a");
printf("------------------------------------------------------------------");
printf("\n CUSTOMER BILL");
printf("\n-----------------------------------------------------------------");
printf("\n ENTER HOW MANY BRANDS YOU ARE
PURCHASE=");
scanf("%d",&brand1.p);
for(i=1;i<=brand1.p;i++)
{
printf(" ENTER THE BRAND PRICE");
scanf("%f",&brand1.w);
brand1.count=brand1.count+brand1.w;
}
printf("TOTAL=%f",brand1.count);
fprintf(sp,"\n QTY OF BRANDS=%d LAST PRICE OF BRAND=%f BILL WAS==%f ",brand1.p,brand1.w,brand1.count);
printf("\n-----------------------------------------------------------------------------------");
printf("\n THANKS FOR PURCHASING OF BRANDS
FROM BAWEJA TRADERS COMPANY ");
printf("\n-------------------------------------------------------------------------------------");
printf("\n HAVE A NICE
DAY");
fclose(sp);
printf("\n PRESS 1 KEY FOR GO IN MAIN MAIN
MENU=");
printf("\n
**********************FOR EXIT PRESS ANY KEY*************= ");
scanf("%d",&e);
if(e==1)
karan();
else
exit();
break;
case
10:
clrscr();
printf("\n-------------------------------------------------------------------------------");
printf("\n RECORDS OF ALL
BILL");
printf("\n-------------------------------------------------------------------------------");
sp=fopen("karan2.dat","r");
while(h!=EOF)
{
h=fgetc(sp);
printf("%c",h);
}
printf("\n PRESS 1 KEY FOR GO IN MAIN
MAIN MENU=");
printf("\n
**********************FOR EXIT PRESS ANY KEY*************= ");
fclose(sp);
scanf("%d",&e);
if(e==1)
karan();
else
exit();
break;
case
11:
exit();
break;
case
3:
clrscr();
printf("\n----------------------------------------------------------------------------");
printf("\n BRANDS AVAILABLE IN BAWEJA
TRADERS COMPANY ");
printf("\n----------------------------------------------------------------------------");
sp=fopen("karan1.txt","a+");
printf("\nif
you want to enter new brand of cookies then press 1 else press any another
key");
scanf("%d",&k);
if(k==1)
{
goto
karan;
}
else
{
goto
baweja;
}
karan:
printf("\nENTER
THE BRAND NAME=");
scanf("%s",&brand1.nam);
printf("\nENTER
THE PRICE OF BRAND NAME=");
scanf("%f",&brand1.pri);
fprintf(sp,"\n
%s %f",brand1.nam,brand1.pri);
fclose(sp);
baweja:
sp=fopen("karan1.txt","r");
while(eh!=EOF)
{
eh=fgetc(sp);
printf("%c",eh);
}
fclose(sp);
printf("\n PRESS 1 KEY FOR GO IN MAIN MAIN
MENU=");
printf("\n
**********************FOR EXIT PRESS ANY KEY*************= ");
scanf("%d",&e);
if(e==1)
karan();
else
exit();
break;
case
4:
clrscr();
printf("\n----------------------------------------------------------------------------");
printf("\n BRANDS AVAILABLE IN BAWEJA
TRADERS COMPANY ");
printf("\n----------------------------------------------------------------------------");
sp=fopen("karan2.txt","a+");
printf("\nif
you want to enter new brand then press 1 else press any another key");
scanf("%d",&kk);
if(kk==1)
{
goto
nilesh;
}
else
{
goto
singh;
}
nilesh:
printf("\nENTER
THE BRAND NAME=");
scanf("%s",&brand1.nam);
printf("\nENTER
THE PRICE OF BRAND NAME=");
scanf("%f",&brand1.pri);
fprintf(sp,"\n
%s %f",brand1.nam,brand1.pri);
fclose(sp);
singh:
sp=fopen("karan2.txt","r");
while(wh!=EOF)
{
wh=fgetc(sp);
printf("%c",wh);
}
printf("\n PRESS 1 KEY FOR GO IN MAIN
MAIN MENU=");
printf("\n
**********************FOR EXIT PRESS ANY KEY*************= ");
scanf("%d",&e);
if(e==1)
karan();
else
exit();
fclose(sp);
break;
case
5:
clrscr();
printf("\n----------------------------------------------------------------------------");
printf("\n BRANDS AVALIABLE IN BAWEJA
TRADERS COMPANY ");
printf("\n----------------------------------------------------------------------------");
sp=fopen("karan3.dat","a+");
printf("\nif
you want to enter new brand then press 1 else press any another key");
scanf("%d",&kkk);
if(kkk==1)
{
goto
key;
}
else
{
goto
board;
}
key:
printf("\nENTER
THE BRAND NAME=");
scanf("%s",&brand1.nam);
printf("\nENTER
THE PRICE OF BRAND NAME=");
scanf("%f",&brand1.pri);
fprintf(sp,"\n
%s %f",brand1.nam,brand1.pri);
fclose(sp);
board:
sp=fopen("karan3.txt","r");
while(th!=EOF)
{
th=fgetc(sp);
printf("%c",th);
}
printf("\n PRESS 1 KEY FOR GO IN MAIN MAIN
MENU=");
printf("\n
**********************FOR EXIT PRESS ANY KEY*************= ");
scanf("%d",&e);
if(e==1)
karan();
else
exit();
fclose(sp);
break;
case
6:
clrscr();
printf("\n----------------------------------------------------------------------------");
printf("\n BRANDS AVAILABLE IN BAWEJA
TRADERS COMPANY ");
printf("\n----------------------------------------------------------------------------");
sp=fopen("karan5.dat","a+");
printf("\nif
you want to enter new brand then press 1 else press any another key");
scanf("%d",&kkkk);
if(kkkk==1)
{
goto
chinku;
}
else
{
goto
chinkuu;
}
chinku:
printf("\nENTER
THE BRAND NAME=");
scanf("%s",&brand1.nam);
printf("\nENTER
THE PRICE OF BRAND NAME=");
scanf("%f",&brand1.pri);
fprintf(sp,"\n
%s %f",brand1.nam,brand1.pri);
fclose(sp);
chinkuu:
sp=fopen("karan5.txt","r");
while(uh!=EOF)
{
uh=fgetc(sp);
printf("%c",uh);
}
printf("\n PRESS 1 KEY FOR GO IN MAIN MAIN
MENU=");
printf("\n
**********************FOR EXIT PRESS ANY KEY*************= ");
scanf("%d",&e);
if(e==1)
karan();
else
exit();
fclose(sp);
break;
case
7:
clrscr();
printf("\n----------------------------------------------------------------------------");
printf("\n BRANDS AVAILABEL IN BAWEJA
TRADERS COMPANY ");
printf("\n----------------------------------------------------------------------------");
sp=fopen("karan6.dat","a+");
printf("\nif
you want to enter new brand then press 1 else press any another key");
scanf("%d",&kkkkk);
if(kkkkk==1)
{
goto
book;
}
else
{
goto
store;
}
book:
printf("\nENTER
THE BRAND NAME=");
scanf("%s",&brand1.nam);
printf("\nENTER
THE PRICE OF BRAND NAME=");
scanf("%f",&brand1.pri);
fprintf(sp,"\n
%s %f",brand1.nam,brand1.pri);
fclose(sp);
store:
sp=fopen("karan6.txt","r");
while(yh!=EOF)
{
yh=fgetc(sp);
printf("%c",yh);
}
printf("\nPRESS
1 KEY FOR GO IN MAIN MAIN MENU=");
printf("\n
**********************FOR EXIT PRESS ANY KEY*************= ");
scanf("%d",&e);
if(e==1)
karan();
else
exit();
fclose(sp);
break;
case
8:
clrscr();
printf("\n----------------------------------------------------------------------------");
printf("\n BRANDS AVAILABLE IN BAWEJA
TRADERS COMPANY ");
printf("\n----------------------------------------------------------------------------");
sp=fopen("karan7.dat","a+");
printf("\nif
you want to enter new brand then press 1 else press any another key");
scanf("%d",&kkkkkk);
if(kkkkkk==1)
{
goto
help;
}
else
{
goto
line;
}
help:
printf("\nENTER
THE BRAND NAME=");
scanf("%s",&brand1.nam);
printf("\nENTER
THE PRICE OF BRAND NAME=");
scanf("%f",&brand1.pri);
fprintf(sp,"\n
%s %f",brand1.nam,brand1.pri);
fclose(sp);
line:
sp=fopen("karan7.txt","r");
while(qh!=EOF)
{
qh=fgetc(sp);
printf("%c",qh);
}
printf("\n PRESS 1 KEY FOR GO IN MAIN MAIN
MENU=");
printf("\n
**********************FOR EXIT PRESS ANY KEY*************= ");
scanf("%d",&e);
if(e==1)
karan();
else
exit();
fclose(sp);
break;
}
return
1;
}
0 comments :
Post a Comment