Professional Documents
Culture Documents
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&
***INTRODUCTION***
/////////////////////////////
/////////////////////////////
####################
# STAR COMPUTERS #
####################
/*
*/
class consumer
{
int cno;
char cname[20];
char adress[20];
int a,b,c;
float i;
public:
public:
void entry()
clrscr();
textcolor(RED);
gotoxy(32,4);
cputs("S.T.A.R COMPUTERS");
gotoxy(5,8);
cputs("Customer ID :");
gotoxy(5,10);
gotoxy(5,12);
gotoxy(5,14);
gotoxy(5,16);
gotoxy(5,18);
gotoxy(5,20);
cin>>cno;
gotoxy(45,10);
gets(cname);
gotoxy(45,12);
gets(adress);
gotoxy(45,14);
cin>>a;
gotoxy(45,16);
cin>>b;
gotoxy(45,18);
cin>>c;
gotoxy(45,20);
cin>>i;
void display()
cout<<"\n\n";
gotoxy(5,8);
cputs("Customer ID :");
cout<<cno;
gotoxy(5,10);
puts(cname);
gotoxy(5,12);
gotoxy(5,14);
gotoxy(5,16);
cout<<"Costumer Smart card number :"<<b;
gotoxy(5,18);
gotoxy(5,20);
int rcno()
return cno;
}c;
void write()
char ch;
consumer c;
fstream f1;
c.entry();
f1.open("main.dat",ios::app|ios::binary);
cin>>ch;
if(ch=='y')
f1.write((char*)&c,sizeof(c));
f1.close();
void read()
consumer c;
fstream f1;
f1.open("main.dat",ios::in|ios::binary);
while(!f1.eof())
f1.read((char*)&c,sizeof(c));
c.display();
if(f1.eof())
f1.close();
void search()
consumer c;
int rn;
char found='n';
ifstream f1("main.dat",ios::in);
cin>>rn;
while(!f1.eof())
f1.read((char*)&c,sizeof(c));
if(c.rcno()==rn)
{
c.display();
found='y';
break;
if(found=='n')
f1.close();
void del()
ifstream f1("main.dat",ios::in);
ofstream f2("temp.dat",ios::out);
int rno;
char found='f',confirm='n';
cin>>rno;
while(!f1.eof())
f1.read((char*)&c,sizeof(c));
if(c.rcno()==rno)
c.display();
found='t';
cin>>confirm;
if(confirm=='n')
f2.write((char*)&c,sizeof(c));
}
else
f2.write((char*)&c,sizeof(c));
if(found=='f')
f1.close();
f2.close();
remove("main.dat");
rename("temp.dat","main.dat");
f1.open("main.dat",ios::in);
clrscr();
while(!f1.eof())
f1.read((char*)&c,sizeof(c));
if(f1.eof())
c.display();
f1.close();
void update()
int rno;
long pos;
char found='f';
cin>>rno;
while(!f1.eof())
pos=f1.tellg();
f1.read((char*)&c,sizeof(c));
if(c.rcno()==rno)
c.entry();
f1.seekg(pos);
f1.write((char*)&c,sizeof(c));
found='t';
break;
if(found=='f')
f1.seekg(0);
clrscr();
c.display();
f1.close();
getch();
void main()
textbackground(LIGHTBLUE);
int
abis=0,apep=0,aden=0,amun=0,aperk=0,acoc=0,atit=0,alux=0,atid=0,aree=0;
char pu,str[10],yes,et;
clrscr();
// WELCOME SCREEN
clrscr();
lab:;
clrscr();
getch();
clrscr();
cout<<"\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t\t\t WELCOME\n\n";
cout<<"\t\t\t\t TO\n\n";
cout<<"\t\t\t\t THE\n\n";
getch();
clrscr();
pass:;
str[0]=getch();
cout<<"*";
str[1]=getch();
cout<<"*";
str[2]=getch();
cout<<"*";
str[3]=getch();
cout<<"*";
str[4]=getch();
cout<<"*";
str[5]=getch();
cout<<"*";
str[6]=getch();
cout<<"*";
str[7]='\0';
cout<<"*";
if(strcmp(str,"michael")==0)
delay(150);
cout<<".";
delay(150);
cout<<".";
delay(150);
cout<<".";
delay(150);
cout<<".";
delay(150);
cout<<".";
delay(150);
cout<<".";
delay(150);
cout<<".";
delay(150);
cout<<".";
delay(150);
cout<<".";
delay(150);
cout<<".";
delay(200);
else
getch();
k++;
//getch();
if(k==3)
getch();
exit(0);
goto pass;
textcolor(RED);
clrscr();
gotoxy(1,6);
textcolor(MAGENTA);
printf("
\n");
printf("**********************************************************************
**********");
textcolor(BLACK+WHITE+BLINK);
cout<<"\n";
printf("**********************************************************************
**********\n");
printf("**********************************************************************
**********\n");
gotoxy(2,21);
textcolor(GREEN);
gotoxy(2,22);
cout<<"\n";
printf("**********************************************************************
**********\n");
printf("**********************************************************************
**********\n");
gotoxy(1,29);
textcolor(BROWN);
cout<<"\n\n";
printf("**********************************************************************
**********\n");
printf("**********************************************************************
**********\n");
gotoxy(1,37);
textcolor(LIGHTGRAY);
gotoxy(1,39);
gotoxy(1,41);
gotoxy(1,43);
cout<<"\n\n";
printf("**********************************************************************
**********\n");
printf("**********************************************************************
**********\n");
cout<<"\n\n";
textcolor(LIGHTCYAN+BLINK);
gotoxy(45,48);
getch();
clrscr();
gotoxy(25,10);
textcolor(RED);
gotoxy(5,15);
cputs("THIS PROJECT CONTAINS SOME ITEMS AND SIMPLE THING YOU HAVE TO
DO IS:-");
gotoxy(5,17);
gotoxy(5,19);
gotoxy(5,21);
gotoxy(5,23);
cputs("YOU CAN ALSO ALL RECORDS YOU HAVE ENTERED IN YOUR COMPUTER.");
gotoxy(5,25);
gotoxy(5,27);
gotoxy(5,29);
cputs("WE ARE NOT RESPONSIBLE FOR ANY DEFECT IN THE PRODUCT YOU
PURCHASE.");
getch();
clrscr();
gotoxy(32,13);
textcolor(LIGHTGREEN);
cputs("********************");
gotoxy(32,15);
cputs("********************");
gotoxy(32,20);
textcolor(MAGENTA+BLINK);
cputs("PLEASE WAIT.........");
textcolor(RED+GREEN);
delay(500);
gotoxy(32,35);
cputs("10 % completed..");
delay(500);
gotoxy(32,35);
cputs("20 % completed...");
delay(500);
gotoxy(32,35);
cputs("30 % completed....");
delay(500);
gotoxy(32,35);
cputs("40 % completed.....");
delay(500);
gotoxy(32,35);
cputs("50 % completed......");
delay(500);
gotoxy(32,35);
cputs("60 % completed.......");
delay(500);
gotoxy(32,35);
cputs("70 % completed........");
delay(500);
gotoxy(32,35);
cputs("80 % completed.........");
delay(500);
gotoxy(32,35);
cputs("90 % completed..........");
delay(500);
gotoxy(32,35);
cputs("100 % completed...........");
delay(500);
again:;
clrscr();
textbackground(LIGHTBLUE);
textcolor(GREEN);
cout<<"\n\t\t\t ^^^^^^^^^^^^^^^^^^^^^^^^^^^";
cout<<"\n\t\t\t !=========================!\n";
cout<<"\n\t\t\t !=========================!";
cout<<"\n\t\t\t ^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\n\n\n\n";
cout<<" \t\t\t$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$";
cout<<"\n\t\t\t$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$";
cin>>d;
switch(d)
{
case 1:
clrscr();
textcolor(WHITE);
write();
start:
cin>>pu;
if(pu=='Y'||pu=='y')
clrscr();
// PURCHASE LIST
items:;
cout<<"\n\t\t\t\t*************";
cout<<"\n\t\t\t\tPURCHASE LIST";
cout<<"\n\t\t\t\t*************\n\n\n\n";
cout<<"\n\n\t\t\t1.PENDRIVE";
cout<<"\n\n\t\t\t2.SCANNER";
cout<<"\n\n\t\t\t3.PRINTER";
cout<<"\n\n\t\t\t4.WEBCAM";
cout<<"\n\n\t\t\t5.GRAPHIC CARD";
cout<<"\n\n\t\t\t6.RAM";
cout<<"\n\n\t\t\t7.HARD DISK";
cout<<"\n\n\t\t\t9.ANTIVIRUS";
cout<<"\n\n\t\t\t10.MOUSE";
cin>>choice;
if(choice==1)
bis:;
clrscr();
cout<<"\n\n\t\t\t\tPENDRIVES\n\n";
cout<<"\n ITEMS\t\t\t\t\tRATE\n";
cout<<"\n 1. 2GB\t\t\t\t\t350\n";
cout<<" 2. 4GB\t\t\t\t\t500\n";
cout<<" 3. 5GB\t\t\t\t\t700\n";
cout<<" 4. 8GB\t\t\t\t\t800\n";
cout<<" 5. 16GB\t\t\t\t\t1800\n";
cout<<" 6. 32GB\t\t\t\t\t2400\n";
cout<<" 7. 64GB\t\t\t\t\t3000\n";
cin>>p1;
if(p1==1)
pend=350;
else if(p1==2)
pend=500;
}
else if(p1==3)
pend=700;
else if (p1==4)
pend=800;
else if(p1==5)
pend=1800;
else if(p1==6)
pend=2400;
else if(p1==7)
pend=3000;
else if(p1==0)
goto items;
else if(p1!=1||p1!=2||p2!=3||p1!=4||p1!=5||p1!=6||p1!=7)
getch();
goto bis;
cin>>m;
if(m>5)
getch();
goto items;
else
abis=1000-m;
cin>>yes;
if(yes=='y')
clrscr();
goto items;
else
clrscr();
goto cash;
if(choice==2)
pep:;
clrscr();
cout<<"\n\n\t\t\t\tSCANNER\n\n";
cout<<"\n ITEMS\t\t\t\tRATE\n";
cout<<"\n 1.FLATBED\t\t\t\t5000\n";
cout<<" 2.SHETFED\t\t\t\t6000\n";
cin>>scan;
if(scan==1)
asc=5000;
else if(scan==2)
asc=6000;
else if(scan==3)
asc=4500;
else if(scan==4)
asc=8000;
else if(scan==5)
asc=10000;
else if(scan==0)
goto items;
else if(scan!=1||scan!=2||scan!=3||scan!=4||p1!=5)
getch();
goto pep;
}
cout<<"\n\n\tSCANNER(MAX 5):\t ";
cin>>n;
if(n>5)
getch();
goto items;
else
apep=1000-n;
cin>>yes;
if(yes=='y')
clrscr();
goto items;
else
clrscr();
goto cash;
if(choice==3)
den:;
clrscr();
cout<<"\n\n\t\t\t\tPRINTER\n\n";
cout<<"\n ITEMS\t\t\t\tRATE\n";
if(p2==1)
print=500;
else if(p2==2)
print=2000;
else if(p2==0)
goto items;
else if(p2!=1||p2!=2)
getch();
goto den;
cin>>o;
if(o>5)
goto items;
else
aden=110-o;
cin>>yes;
if(yes=='y')
{
clrscr();
goto items;
else
clrscr();
goto cash;
if(choice==4)
mun:;
clrscr();
cout<<"\n\n\t\t\t\tWEBCAM\n\n";
cout<<"\n ITEMS\t\t\t\t\tRATE\n";
cin>>web;
if(web==1)
aweb=1500;
else if(web==2)
aweb=6000;
else if(web==3)
aweb=12000;
}
else if(web==0)
goto items;
else if(web!=1||web!=2||web!=3)
getch();
goto mun;
cin>>p;
if(p>5)
getch();
goto items;
else
amun=1000-p;
cin>>yes;
if(yes=='y')
clrscr();
goto items;
else
clrscr();
goto cash;
}
if(choice==5)
park:;
clrscr();
cout<<"\n\n\t\t\t\tGRAPHIC CARD\n\n";
cout<<"\n ITEMS\t\t\t\t\tRATE\n";
cout<<"\n 1. 32 bit\t\t\t\t\t5000\n";
cout<<" 2. 64 bit\t\t\t\t\t8000\n";
cin>>g1;
if(g1==1)
graph=5000;
else if(g1==2)
graph=8000;
else if(g1==0)
goto items;
else if(g1!=1||g1!=2)
getch();
goto park;
cin>>q;
if(q>5)
getch();
goto items;
else
aperk=500-q;
cin>>yes;
if(yes=='y')
clrscr();
goto items;
else
clrscr();
goto cash;
if(choice==6)
coco:;
clrscr();
cout<<"\n\n\t\t\t\tRAM\n\n";
cout<<"\n ITEMS\t\t\t\t\tRATE\n";
cout<<"\n 1. 1GB\t\t\t\t\t2000\n";
cout<<" 2. 2GB\t\t\t\t\t4000\n";
cin>>r1;
if(r1==1)
{
ram=2000;
else if(r1==2)
ram=4000;
else if(r1==0)
goto items;
else if(r1!=1||r1!=2)
getch();
goto coco;
cin>>r;
if(r>2)
getch();
goto items;
else
acoc=400-r;
cin>>yes;
if(yes=='y')
clrscr();
goto items;
else
clrscr();
goto cash;
if(choice==7)
titan:;
clrscr();
cout<<"\n\n\t\t\t\tHARD DISK\n\n";
cout<<"\n ITEMS\t\t\t\t\tRATE\n";
cout<<"\n 1. 20GB\t\t\t\t\t1500\n";
cout<<" 2. 50GB\t\t\t\t\t2000\n";
cout<<" 3. 80GB\t\t\t\t\t3000\n";
cout<<" 4. 160GB\t\t\t\t\t5000\n";
cout<<" 5. 320GB\t\t\t\t\t8000\n";
cin>>h1;
if(h1==1)
hard=1500;
else if(h1==2)
hard=2000;
else if(h1==3)
hard=3000;
}
else if(h1==4)
hard=5000;
else if(h1==5)
hard=8000;
else if(h1==0)
goto items;
else if(h1!=1||h1!=2||h1!=3||h1!=4||h1!=5)
getch();
goto titan;
cin>>s;
if(s>5)
getch();
goto items;
else
atit=100-s;
cin>>yes;
if(yes=='y')
{
clrscr();
goto items;
else
clrscr();
goto cash;
if(choice==8)
lux:;
clrscr();
cout<<"\n ITEMS\t\t\t\tRATE\n";
cout<<"\n 1. 98\t\t\t\t\t1500\n";
cout<<" 2. 2000\t\t\t\t2000\n";
cout<<" 3. XP\t\t\t\t\t4000\n";
cout<<" 4. VISTA\t\t\t\t8000\n";
cout<<" 5. windows7\t\t\t\t11000\n";
cin>>w1;
if(w1==1)
win=1500;
else if(w1==2)
win=2000;
}
else if(w1==3)
win=4000;
else if(w1==4)
win=8000;
else if(w1==5)
win=11000;
else if(w1==0)
goto items;
else if(w1!=1||w1!=2||w1!=3||w1!=4||w1!=5)
cout<<"\n\n\tOOPS!!!!!!!Wrong choice\n\n";
getch();
goto lux;
cin>>t;
if(t>5)
getch();
goto items;
else
alux=1000-t;
cout<<"\n\tDO you want to purchase more(y/n)";
cin>>yes;
if(yes=='y')
clrscr();
goto items;
else
clrscr();
goto cash;
if(choice==9)
tid:;
clrscr();
cout<<"\n\n\t\t\t\tANTIVIRUS\n\n";
cout<<"\n ITEMS\t\t\t\tRATE\n";
cout<<"\n 1. NORTON\t\t\t\t1500\n";
cout<<" 2. AVIRA\t\t\t\t1200\n";
cout<<" 3. QUICKHEAL\t\t\t\t1300\n";
cin>>an1;
if(an1==1)
ant=1500;
else if(an1==2)
ant=1200;
}
else if(an1==3)
ant=1300;
else if(an1==0)
goto items;
else if(an1!=1||an1!=2||an1!=3)
cout<<"\n\n\tOOPS!!!!!!!Wrong choice\n\n";
getch();
goto tid;
cin>>u;
if(u>5)
getch();
goto items;
else
atid=1000-u;
cin>>yes;
if(yes=='y')
clrscr();
goto items;
else
{
clrscr();
goto cash;
if(choice==10)
ree:;
clrscr();
cout<<"\n\n\t\t\t\tMOUSE\n\n";
cout<<"\n ITEMS\t\t\t\tRATE\n";
cin>>mous;
if(mous==1)
mo=150;
else if(mous==2)
mo=300;
else if(mous==0)
goto items;
else if(mous!=1||mous!=2)
cout<<"\n\n\tOOPS!!!!!!!Wrong choice\n\n";
getch();
goto ree;
}
cin>>v;
if(v>2)
getch();
goto items;
else
aree=300-v;
cin>>yes;
if(yes=='y')
clrscr();
else
clrscr();
cout<<"\n\n\n";
clrscr();
cash:;
cout<<"\n\n\n\n\n\n\n\n";
c.display();
cout<<"\n\n\n\n";
cout<<"=======================================================================
========";
cout<<"\nITEMS"
<<setw(40)<<"QUANTITY"<<setw(35)<<"PRICE(Rs.)";
cout<<"=======================================================================
========";
if(m>0)
cout<<"\n\nPENDRIVE"
<<setw(35)<<m<<setw(28)<<"Rs."<<m*pend;
if(n>0)
cout<<"\n\nSCANNER"
<<setw(36)<<n<<setw(28)<<"Rs."<<n*asc;
if(o>0)
cout<<"\n\nPRINTER"
<<setw(36)<<o<<setw(28)<<"Rs."<<o*print;
if(p>0)
cout<<"\n\nWEBCAM"
<<setw(37)<<p<<setw(28)<<"Rs."<<p*aweb;
if(q>0)
cout<<"\n\nGRAPHIC CARD"
<<setw(31)<<q<<setw(28)<<"Rs."<<q*graph;
if(r>0)
cout<<"\n\nRAM"
<<setw(40)<<r<<setw(28)<<"Rs."<<r*ram;
if(s>0)
cout<<"\n\nHARD DISK"
<<setw(34)<<s<<setw(28)<<"Rs."<<s*hard;
if(t>0)
if(u>0)
cout<<"\n\nANTIVIRUS"
<<setw(34)<<u<<setw(28)<<"Rs."<<u*ant;
if(v>0)
cout<<"\n\nMOUSE"
<<setw(38)<<v<<setw(28)<<"Rs."<<v*mo;
e=m*pend;
f=n*asc;
g=o*print;
h=p*aweb;
k=q*graph;
l=r*ram;
w=s*hard;
x=t*win;
y=u*ant;
z=v*mo;
cout<<"\n=====================================================================
==========";
cout<<"\nTOTAL:"<<setw(38)<<add<<setw(27)<<"Rs."<<sum;
money:;
cin>>total;
getch();
goto money;
clrscr();
getch();
goto again;
else
clrscr();
getch();
goto again;
case 2:
clrscr();
cout<<"\n\n\n\n\n\t\t\t\tSHOP DETAILS\n\n\n";
cout<<"\n\t%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%\n\n";
cout<<"\n\t%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%\n\n";
getch();
clrscr();
goto again;
case 3:
clrscr();
search();
getch();
goto again;
case 4:
clrscr();
del();
getch();
goto again;
case 5:
clrscr();
update();
getch();
goto again;
case 6:
{
clrscr();
read();
getch();
goto again;
case 7:
clrscr();
if(m>0||n>0||o>0||p>0||q>0||r>0||s>0||t>0||u>0||v>0)
cout<<"=======================================================================
========";
cout<<"\nITEMS" <<setw(40)<<"QUANTITY";
cout<<"\n=====================================================================
==========";
cout<<"\n\n\nPENDRIVE" <<setw(37)<<abis;
cout<<"\n\n\nSCANNER" <<setw(38)<<apep;
cout<<"\n\n\nPRINTER" <<setw(38)<<aden;
cout<<"\n\n\nWEBCAM" <<setw(39)<<amun;
cout<<"\n\n\nRAM" <<setw(42)<<acoc;
cout<<"\n\n\nANTIVIRUS" <<setw(36)<<atid;
cout<<"\n\n\nMOUSE" <<setw(40)<<aree;
cout<<"\n*********************************************************************
**********";
getch();
goto again;
else
cout<<"=======================================================================
========";
cout<<"\nITEMS" <<setw(40)<<"QUANTITY";
cout<<"\n=====================================================================
==========";
cout<<"\n\n\nPENDRIVE" <<setw(37)<<1000;
cout<<"\n\n\nSCANNER" <<setw(38)<<1000;
cout<<"\n\n\nPRINTER" <<setw(37)<<110;
cout<<"\n\n\nWEBCAM" <<setw(39)<<1000;
cout<<"\n\n\nRAM" <<setw(41)<<400;
cout<<"\n\n\nANTIVIRUS" <<setw(36)<<1000;
cout<<"\n\n\nMOUSE" <<setw(39)<<300;
cout<<"\n\n*******************************************************************
************";
getch();
goto again;
case 0:
clrscr();
cin>>et;
if(et=='y')
goto ex;
else
goto again;
ex:;
clrscr();
textcolor(RED);
sleep(1);
clrscr();
gotoxy(35,10);
sleep(1);
clrscr();
gotoxy(35,20);
sleep(1);
clrscr();
gotoxy(28,30);
cout<<" THANK YOU FOR USING THE PROJECT\n\n\n\n ";
gotoxy(35,35);
textcolor(GREEN+BLINK);
gotoxy(35,25);
textcolor(RED+YELLOW);
delay(1000);
gotoxy(45,45);
textcolor(YELLOW+BLINK);
getch();
exit(0);
default:
getch();
goto again;