Вы находитесь на странице: 1из 14

SOURCE

CODE
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<string.h>
#include<stdio.h>
class shop
{
int size,price;
double mobileno;
char
colour[20],name[20],add[20],email[20
];
public:
void getdata();
void tshirts();
void blazer();
void saree();
void display();
void input();
void shoes();
void watch();
void pro();
void frock();
void cart();
friend void getproducts();
};

void shop::tshirts()
{
int ch;
cout<<" 1.HALF-TSHIRTS -:";
cout<<"\n 2.HALF T-SHIRTS
WITH COLOUR -:";
cout<<"\n 3.full T-SHIRTS -:";
cout<<"\n 4.full T-SHIRTS -:";
cout<<"\n 5.back to previous
menu -:";
cout<<"\n enter your choice
-:";
cin>>ch;
switch(ch)
{
case 1:
getdata();
break;
case 2:
getdata();
break;
case 3:
getdata();
break;
case 4:
getdata();
break;
case 5:
goto second;

void shop::blazer()
{
int p;
cout<<"\n 1.modi kurta -:";
cout<<"\n 2.half blazer -:";
cout<<"\n 3.suits -:";
cout<<"\n 4. back to
previous menu -:";
cout<<"\n enter your
choice -:";
cin>>p;
switch(p)
{
case 1:
getdata();
break;
case 2:
getdata();
break;
case 3:
getdata();
break;
case 4:
goto second;
default : cout<<"\n wrong
input";
}
}

void shop::saree()
{
int k;
cout<<"\n 1.cotton saree -:";
cout<<"\n 2.silk saree -:";
cout<<"\n 3.party saree -:";
cout<<"\n 4.terecotta saree
-:";
cout<<"\n 5.back to previous
menu -:";
cout<<"\n enter your choice
-:";
cin>>k;
switch(k)
{
case 1:
getdata();
break;
case 2:
getdata();
break;
case 3:
getdata();
break;
case 4:
getdata();
break;
case 5:
goto second;
default : cout<<"\n wrong

void shop::frock()
{
int choice;
cout<<"\n 1.half seleves frock
-:";
cout<<"\n 2.full seleves frock
-:";
cout<<"\n 3.casual frock for
summer -:";
cout<<"\n 4.babydoll frock -:";
cout<<"\n 5.back to previous
menu -:";
cout<<"\n enter your choice
-:";
cin>>choice;
switch(choice)
{
case 1:
getdata();
break;
case 2:
getdata();
break;
case 3:
getdata();
break;
case 4:
getdata();
break;
case 5:
goto second;
default : cout<<"\n wrong

void shop::shoes()
{
int il;
cout<<"\n 1.sports shoes
-:";
cout<<"\n 2.party shoes -:";
cout<<"\n 3.school shoes
-:";
cout<<"\n 4.canvas shoes
-:";
cout<<"\n 5.back to
previous menu ";
cout<<"\n enter your choice
-:";
cin>>il;
switch(il)
{
case 1:
getdata();
break;
case 2:
getdata();
break;
case 4:
getdata();
break;
case 5:
goto second;
default :cout<<"\n wrong

void shop::watch()
{
int u;
char c[10];
cout<<"enter brand -:";
gets(c);
cout<<"\n 1.wrist watch -:";
cout<<"\n 2.wall clock -:";
cout<<"\n 3.table clock -:";
cout<<"\n 4.back to previous
menu";
cout<<"\n enter your choice -:";
cin>>u;
switch(u)
{
case 1:
getdata();
break;
case 2:
getdata();
break;
case 3:
getdata();
break;
case 4:
goto second;
default :cout<<"\n wrong
choice";
}
}

void shop::display()
{
cout<<"\n price
-:"<<price;
cout<<"\n size -:"<<size;
cout<<"\n colour
-:"<<colour;
}
void shop::getdata()
{
shop s;
char test[5],fail[5];
int T;
cout<<"\n 1.BUY NOW -:";
cout<<"\n 2.ADD TO CART
-:";
switch(T)
cout<<"\n enter your
{
choice -:";
case 1:
cin>>T;
cout<<"\n enter price -:";
cin>>price;
cout<<"\n enter your size -:";
cin>>size;
cout<<"\n enter your colour -:";
gets(colour);
cout<<"\n enter your name -:";
gets(name);
cout<<"\n enter your address
-:";
gets(add);
cout<<"\n enter your mobile no

cin>>mobileno;
cout<<"\n enter your Email ID -:";
gets(email);
cout<<"\n DO YOU WANT MORE BUY -:";
cout<<"\n enter y or n ";
cin>>test;
if(test=='y'|| test=='y')
continue;
else
goto out1;
ofstream fout("order.dat");
fout.write((char*)&s,sizeof(s));
fout.close();
cout<<"\n ORDER SUESSFULL $";
cout<<"\n YOUR ORDER IS DELIVERED WITHIN
15 DAYS";
cout<<"\n THANK U FOR SHOPPING";
out1:
break;
case 2:
cout<<"\n enter price -:";
cin>>price;
cout<<"\n enter your size -:";
cin>>size;
cout<<"\n enter your colour -:";
gets(colour);
cout<<"\n ADD TO CART -:";
cout<<"\n DO YOU WANT TO ADD MORE";

cout<<"\n enter y or n -:";


cin>>fail;
if(fail=='y'||fail=='y')
continue;
else
goto out2;
ofstream fo("cart.dat");
fo.write((char*)&s,sizeof(s));
fo.close();
out2:
break;
default : cout<<"wrong choice";
}}
void main()
{
shop x; start:
int o,d,f;
clrscr();
cout<<"\n\n============WELCOME TO
THE INDIA's No.1 ONLINE SHOPPING
SITE===========";
cout<<"\n============,,<<<<PROJECT
ON ONLINE SHOOPING BY RAVI
KUMAR>>>>=======";
cout<<"\n 1.MENS WEAR -:";
cout<<"\n 2.womens wear -:";
cout<<"\n 3.kids wear -:";
cout<<"\n4.back to main menu"

cout<<"\n enter your choice -:";


cin>>o;
switch(o)
{
case 1:
second:
cout<<"\n\n=======WELCOME TO MEN's
WEAR CORNER===============";
cout<<"\n 1.t-shirts -:";
cout<<"\n 2.blazer -:";
cout<<"\n 3.watch -:";
cout<<"\n 4.shoes -:";
cout<<"\n5.back to main menu";
cout<<"\n enter your choice -:";
cin>>d;
switch(d)
{
case 1:
cout<<"\n\n========WELCOME TO MEN's TSHIRTS CORNER=======";
x.tshirts();
break;
case 2:
cout<<"\n\n=======WELCOME TO MEN's
BLAZER CORNER=====";
x.blazer();
break;

cout<<"\n\n=======WELCOME TO MEN's
WATCH CORNER=====>>>";
x.watch();
break;
case 4:
cout<<"\n\n<<<<======WELCOME TO
MENS's SHOES CORNER=====>>>";
x.shoes();
case 5:
goto start;
default :
cout<<"\n wrong choice -:";
}
case 2:
cout<<"\n\n<<<<=======WELCOME TO
SAREE SECTION======>>>>>";
x.saree();
break;
case 3:
cout<<"\n\n<<<<=======WELCOME TO
KIDS WEAR CORNER===>>>>";
x.frock();
break;

case 4:
goto finish;
default :
cout<<"\n WRONG CHOICE :-";
}
finish:
cout<<"\n 1.visit your order -:";
cout<<"\n 2.visit your cart -:";
cout<<"\n 3,exit";
cout<<"\n enter your choice -:";
cin>>f;
switch(f)
{
case 1:
ifstream fin("order.dat");
fin.read((char*)&x,sizeof(x));
x.display();
fin.close();
break;
case 2:
ifstream fi("cart.dat");
fi.read((char*)&x,sizeof(x));
x.display();

fi.close();
break;
case 3:
goto end;
default :
cout<<"wrong choice";
}
end:
getch();
}

Вам также может понравиться