Professional Documents
Culture Documents
h>
#include<string.h>
#include<conio.h>
#include<stdio.h>
#include<dos.h>
#include<process.h>
struct dat {
int dd,mm,yy;
};
struct sales {
char it_code[5],it_name[20];
float it_rate;
};
struct customer {
int memo;
char i_code[5];
char i_name[20];
float quantity;
float rate;
};
sales s[30];
customer c[30];
void order(void);
void bill(void);
void address(void);
char ans;
int i,ch,n,m,p; char u,mpsd[4];
void main()
{ char psd[4];
{clrscr();
gotoxy(33,13);
cout<<"JK SUPER MARKET";
for(i=10;i<=15;++i)
{gotoxy(30,i);
delay(100);
cout<<"*";
}
for(i=30;i<=51;++i)
{gotoxy(i,15);
delay(100);
cout<<"*";
}
for(i=10;i<=15;++i)
{gotoxy(35,i);
delay(100);
cout<<"*";
}
for(i=30;i<=51;++i)
{gotoxy(i,10);
delay(100);
cout<<"*";
}
gotoxy(20,20);
cout<<"\nThe shop is empty now please add some products";
{char ans;
int i=0;
ans='y';
do
{clrscr();
gotoxy(20,6);
cout<<"Name of the item=>";
cin>>s[i].it_name;
gotoxy(20,8);
cout<<"CODE OF THE ITEM";
cin>>s[i].it_code;
gotoxy(20,10);
cout<<"RATE OF THE ITEM";
cin>>s[i].it_rate;
gotoxy(20,22);
cout<<"do you want to continue?(press y)";
cin>>ans;
++i;
}while(ans=='y');
cout<<"\n new products have been added to the store ,now the customer can place the
order";
n=i;
order();
}
cout<<"\n\n do want the products to be delivered?(press y for yes)";
delay(120);
cout<<"\nFREE DELIVERY IF THE PURCHASE EXCEEDS Rs.1000\tELSE Rs.25FOR DELIVERY";
cin>>u;
if(u=='y')
{cout<<"\n\nEnter distance (kilometer) from here ";
cin>>p;
if(p<=5)
address();
else
cout<<"\n\nlimit is only upto 5 km. SORRY PRODUCTS CANNOT BE DELIVERED";
}
}
}
if(u=='y')
{if(gtotal<1000)
cout<<"\ndelivery charges:\t\tRs.25:";
gtotal+=25;}
cout<<"\n GST(tax)\t\t(10%)";
float tax;
tax=gtotal*10/100;
gtotal+=tax;
gotoxy(20,23);
cout<<"GRAND TOTAL"<<gtotal;
getch();}
void address()
{
int house_no;
char street_name[50],land_mark[50];
long double pin_code;
cout<<"\nenter house number";
cin>>house_no;
cout<<"enter street name";
gets(street_name);
cout<<"\nenter land mark";
gets(land_mark);
cout<<"\nenter pin code";
cin>>pin_code;
cout<<"\n your order will be delivered tomorrow";
}