_______________________________
ShopCard
______________________________________
Presented By
Harsh Mathur
Bachelors of Computer Application
Dezyne E’cole College, Ajmer
Project report on
Shop Card
Submitted To
Dezyne E’cole College
Towards
The Partial Fulfilment
Of 2017 Year, Bachelor of Computer Application
By
Harsh Mathur
Dezyne E’cole College
106/10, Civil Line Ajmer
www.dezyneecole.com
Acknowledgment
I Am Harsh Mathur Student of Bachelor Of Computer Application
Dezyne E’cole College Would Like To Express My Gratitude to Each
And Every Person Who Has Contributed In Stimulating Suggestions
And Encouragement Which Really Helped Me to Coordinate My
Project.
I Also Thank Dezyne E’cole College Who Provided Insight And Expertise
That Greatly Assisted the Project. Also, a Special Thanks To My
Teachers, Parents and Colleagues Who Have Supported Me At Every
Step. Not To Forget, the Almighty Who Blessed Me With Good Health
Because of Which I Worked More Efficiently And Better.
In the following pages I am showcasing my work:
Front Page
1 | P a g e
void main()
{
clrscr();
textbackground(1);
gotoxy(32,8);
cout<<"1. ADD "<<endl;
gotoxy(32,10);
cout<<"2. SHOW "<<endl;
gotoxy(32,12);
cout<<"3. UPDATE "<<endl;
gotoxy(32,14);
cout<<"4. Billing "<<endl;
gotoxy(32,16);
cout<<"5. Delete "<<endl;
gotoxy(32,18);
cout<<"6. Exit"<<endl;
2 | P a g e
char c;
c=getch();
store s,y;
if(c=='1')
{
clrscr();
s.get();
s.add(s);
}
else if(c=='2')
{
clrscr();
y.show();
}
else if(c=='3')
{
clrscr();
y.update();
}
3 | P a g e
else if(c=='4')
{
clrscr();
y.autoid();
y.Bill();
}
else if(c=='5')
{
clrscr();
y.del();
}
else if(c=='6')
{
clrscr();
exit(0);
}
gotoxy(20,20);
4 | P a g e
cout<<"nttDo you Want to
continue..press 1 else any key.. ";
c=getch();
if(c=='1')
{
main();
}
else
{
exit(0);
}
getch();
}
5 | P a g e
ADD DATA
6 | P a g e
#include<iostream.h>
#include<conio.h>
#include<fstream.h>
#include<stdio.h>
#include<stdlib.h>
int c=1000;
class store
{
public:
int id,q;
char n[20];
float dis,r;
void get()
{ clrscr();
gotoxy(30,8);
cout<<"Enter your id:: ";
cin>>id;
7 | P a g e
gotoxy(30,10);
cout<<"Enter Product Name name";
cin>>n;
gotoxy(30,12);
cout<<"EnterDisountProduct::";
cin>>dis;
gotoxy(30,14);
cout<<"Enter Qty of Product:: ";
cin>>q;
gotoxy(30,16);
cout<<"Enter Rate Product:: ";
cin>>r;
}
void add(store x)
{
fstream f;
f.open("shopdata.txt",ios::out|app);
f.write((char *)&x,sizeof(x));
gotoxy(40,20);
cout<<"Data succesfully inserted ";
8 | P a g e
f.close();
}
SHOW DATA
9 | P a g e
void show()
{
store x;
int c=0;
fstream f1;
f1.open("shopdata.txt",ios::in);
gotoxy(5,5);
cout<<"tIdtProduct_NamettDiscounttQtyttRate";
while(f1.read((char*)&x,sizeof(x)))
{
cout<<"t"<<x.id<<"t";
cout<<x.n<<"tt";
cout<<x.dis<<"%"<<"tt";
cout<<x.q<<"tt";
cout<<x.r<<endl;
}
f1.close();
10 | P a g e
}
UPDATE RECORD
11 | P a g e
void update()
{
int nid;
//clrscr();
gotoxy(30,2);
cout<<"*****UPDATERECORD******;
gotoxy(30,6);
cout<<"Enter Product id Update:: ";
cin>>nid;
store x;
int c=0;
fstream f1,f;
f1.open("shopdata.txt",ios::in);
while(f1.read((char*)&x,sizeof(x)))
{
f.open("temp.txt",ios::out|ios::app);
if(x.id==nid)
{
gotoxy(30,8);
12 | P a g e
cout<<"Enter your id:: "<<x.id;
gotoxy(30,10);
cout<<"Enter Product Name:: ";
gets(x.n);
gotoxy(30,12);
cout<<"Enter your Rate:: ";
cin>>x.r;
gotoxy(30,14);
cout<<"Enter your Product Qty :: ";
cin>>x.q;
gotoxy(30,16);
cout<<"Enter your Discount on Qty :: ";
cin>>x.dis;
f.write((char *)&x,sizeof(x));
}
else
{
f.write((char*)&x,sizeof(x));
}
f.close();
}
13 | P a g e
f1.close();
remove("shopdata.txt");
rename("temp.txt","shopdata.txt");
}
14 | P a g e
DELETE RECORD
15 | P a g e
void del()
{
int nid;
gotoxy(30,2);
cout<<"*****DELETERECORD******;
gotoxy(30,10);
cout<<"Enter a id::";
cin>>nid;
store x;
int c=0;
fstream f,f1;
f1.open("shopdata.txt",ios::in)
while(f1.read((char*)&x,sizeof(x)))
{
f.open("temp.txt",ios::out|ios::app);
if(nid==x.id)
{
gotoxy(30,18);
cout<<"Data Successful Delete";
16 | P a g e
}
else
{
f.write((char *)&x,sizeof(x));
}
f.close();
}
f1.close();
remove("shopdata.txt");
rename("temp.txt","shopdata.txt");
}
17 | P a g e
RETAIL INVOICE
18 | P a g e
void Bill()
{
store x;
int pid,i,max,no;
char cn[20];
float d,net;
fstream f1;
f1.open("shopdata.txt",ios::in);
gotoxy(25,8);
cout<<"Enter a Product id";
gotoxy(35,9);
cin>>pid;
clrscr();
textcolor(14);
gotoxy(30,2);
cout<<"***Retail Invoice***";
gotoxy(2,4);
cout<<"Customer Name::";
cin>>cn;
19 | P a g e
cout<<"nIdttProduct_NamettRatettDiscount";
while(f1.read((char *)&x,sizeof(x)))
{
if(x.id==pid)
{
cout<<endl<<x.id<<"tt";
cout<<x.n<<"tt";
cout<<x.r<<"tt";
cout<<x.dis<<"%"<<endl;
c++;
int pqt,multi;
cout<<"nEnter a Product Qty:";
cin>>pqt;
multi=pqt*x.r;
d=multi*pqt*x.dis/100;
net=multi-d;
cout<<"Bill id is::";
c=autoid();
gotoxy(58,10);
20 | P a g e
cout<<c;
cout<<"nTotal Amount Is::";
gotoxy(58,11);
cout<<multi<<" Rs.";
cout<<"nTotal Discount Amount Is::";
gotoxy(58,12);
cout<<d<<" Rs.";
cout<<"nNet Amount Is::";
gotoxy(58,13); clrscr();
textcolor(14);
gotoxy(30,2);
cout<<"***Retail Invoice***";
gotoxy(2,4);
cout<<"Customer Name::";
cin>>cn;
cout<<"nIdttProduct_NamettRatettDiscount";
while(f1.read((char *)&x,sizeof(x)))
{
if(x.id==pid)
{
21 | P a g e
cout<<endl<<x.id<<"tt";
cout<<x.n<<"tt";
cout<<x.r<<"tt";
cout<<x.dis<<"%"<<endl;
c++;
int pqt,multi;
cout<<"nEnter a Product Qty:";
cin>>pqt;
multi=pqt*x.r;
d=multi*pqt*x.dis/100;
net=multi-d;
cout<<"Bill id is::";
c=autoid();
gotoxy(58,10);
cout<<c;
cout<<"nTotal Amount Is::";
gotoxy(58,11);
cout<<multi<<" Rs.";
cout<<"nTotal Discount Amount Is::";
22 | P a g e
gotoxy(58,12);
cout<<d<<" Rs.";
cout<<"nNet Amount Is::";
gotoxy(58,13);
cout<<net<<" Rs.";
break;
}
}
if(c==0)
{
cout<<"nData NOT Found::";
}
f1.close();
}
23 | P a g e
Thank You
Presented By
Harsh Mathur
Bachelors of Computer Application
Dezyne E’cole College, Ajmer
24 | P a g e

Harsh Mathur project c++

  • 1.
  • 2.
    Project report on ShopCard Submitted To Dezyne E’cole College Towards The Partial Fulfilment Of 2017 Year, Bachelor of Computer Application By Harsh Mathur Dezyne E’cole College 106/10, Civil Line Ajmer www.dezyneecole.com
  • 3.
    Acknowledgment I Am HarshMathur Student of Bachelor Of Computer Application Dezyne E’cole College Would Like To Express My Gratitude to Each And Every Person Who Has Contributed In Stimulating Suggestions And Encouragement Which Really Helped Me to Coordinate My Project. I Also Thank Dezyne E’cole College Who Provided Insight And Expertise That Greatly Assisted the Project. Also, a Special Thanks To My Teachers, Parents and Colleagues Who Have Supported Me At Every Step. Not To Forget, the Almighty Who Blessed Me With Good Health Because of Which I Worked More Efficiently And Better.
  • 4.
    In the followingpages I am showcasing my work: Front Page
  • 5.
    1 | Pa g e void main() { clrscr(); textbackground(1); gotoxy(32,8); cout<<"1. ADD "<<endl; gotoxy(32,10); cout<<"2. SHOW "<<endl; gotoxy(32,12); cout<<"3. UPDATE "<<endl; gotoxy(32,14); cout<<"4. Billing "<<endl; gotoxy(32,16); cout<<"5. Delete "<<endl; gotoxy(32,18); cout<<"6. Exit"<<endl;
  • 6.
    2 | Pa g e char c; c=getch(); store s,y; if(c=='1') { clrscr(); s.get(); s.add(s); } else if(c=='2') { clrscr(); y.show(); } else if(c=='3') { clrscr(); y.update(); }
  • 7.
    3 | Pa g e else if(c=='4') { clrscr(); y.autoid(); y.Bill(); } else if(c=='5') { clrscr(); y.del(); } else if(c=='6') { clrscr(); exit(0); } gotoxy(20,20);
  • 8.
    4 | Pa g e cout<<"nttDo you Want to continue..press 1 else any key.. "; c=getch(); if(c=='1') { main(); } else { exit(0); } getch(); }
  • 9.
    5 | Pa g e ADD DATA
  • 10.
    6 | Pa g e #include<iostream.h> #include<conio.h> #include<fstream.h> #include<stdio.h> #include<stdlib.h> int c=1000; class store { public: int id,q; char n[20]; float dis,r; void get() { clrscr(); gotoxy(30,8); cout<<"Enter your id:: "; cin>>id;
  • 11.
    7 | Pa g e gotoxy(30,10); cout<<"Enter Product Name name"; cin>>n; gotoxy(30,12); cout<<"EnterDisountProduct::"; cin>>dis; gotoxy(30,14); cout<<"Enter Qty of Product:: "; cin>>q; gotoxy(30,16); cout<<"Enter Rate Product:: "; cin>>r; } void add(store x) { fstream f; f.open("shopdata.txt",ios::out|app); f.write((char *)&x,sizeof(x)); gotoxy(40,20); cout<<"Data succesfully inserted ";
  • 12.
    8 | Pa g e f.close(); } SHOW DATA
  • 13.
    9 | Pa g e void show() { store x; int c=0; fstream f1; f1.open("shopdata.txt",ios::in); gotoxy(5,5); cout<<"tIdtProduct_NamettDiscounttQtyttRate"; while(f1.read((char*)&x,sizeof(x))) { cout<<"t"<<x.id<<"t"; cout<<x.n<<"tt"; cout<<x.dis<<"%"<<"tt"; cout<<x.q<<"tt"; cout<<x.r<<endl; } f1.close();
  • 14.
    10 | Pa g e } UPDATE RECORD
  • 15.
    11 | Pa g e void update() { int nid; //clrscr(); gotoxy(30,2); cout<<"*****UPDATERECORD******; gotoxy(30,6); cout<<"Enter Product id Update:: "; cin>>nid; store x; int c=0; fstream f1,f; f1.open("shopdata.txt",ios::in); while(f1.read((char*)&x,sizeof(x))) { f.open("temp.txt",ios::out|ios::app); if(x.id==nid) { gotoxy(30,8);
  • 16.
    12 | Pa g e cout<<"Enter your id:: "<<x.id; gotoxy(30,10); cout<<"Enter Product Name:: "; gets(x.n); gotoxy(30,12); cout<<"Enter your Rate:: "; cin>>x.r; gotoxy(30,14); cout<<"Enter your Product Qty :: "; cin>>x.q; gotoxy(30,16); cout<<"Enter your Discount on Qty :: "; cin>>x.dis; f.write((char *)&x,sizeof(x)); } else { f.write((char*)&x,sizeof(x)); } f.close(); }
  • 17.
    13 | Pa g e f1.close(); remove("shopdata.txt"); rename("temp.txt","shopdata.txt"); }
  • 18.
    14 | Pa g e DELETE RECORD
  • 19.
    15 | Pa g e void del() { int nid; gotoxy(30,2); cout<<"*****DELETERECORD******; gotoxy(30,10); cout<<"Enter a id::"; cin>>nid; store x; int c=0; fstream f,f1; f1.open("shopdata.txt",ios::in) while(f1.read((char*)&x,sizeof(x))) { f.open("temp.txt",ios::out|ios::app); if(nid==x.id) { gotoxy(30,18); cout<<"Data Successful Delete";
  • 20.
    16 | Pa g e } else { f.write((char *)&x,sizeof(x)); } f.close(); } f1.close(); remove("shopdata.txt"); rename("temp.txt","shopdata.txt"); }
  • 21.
    17 | Pa g e RETAIL INVOICE
  • 22.
    18 | Pa g e void Bill() { store x; int pid,i,max,no; char cn[20]; float d,net; fstream f1; f1.open("shopdata.txt",ios::in); gotoxy(25,8); cout<<"Enter a Product id"; gotoxy(35,9); cin>>pid; clrscr(); textcolor(14); gotoxy(30,2); cout<<"***Retail Invoice***"; gotoxy(2,4); cout<<"Customer Name::"; cin>>cn;
  • 23.
    19 | Pa g e cout<<"nIdttProduct_NamettRatettDiscount"; while(f1.read((char *)&x,sizeof(x))) { if(x.id==pid) { cout<<endl<<x.id<<"tt"; cout<<x.n<<"tt"; cout<<x.r<<"tt"; cout<<x.dis<<"%"<<endl; c++; int pqt,multi; cout<<"nEnter a Product Qty:"; cin>>pqt; multi=pqt*x.r; d=multi*pqt*x.dis/100; net=multi-d; cout<<"Bill id is::"; c=autoid(); gotoxy(58,10);
  • 24.
    20 | Pa g e cout<<c; cout<<"nTotal Amount Is::"; gotoxy(58,11); cout<<multi<<" Rs."; cout<<"nTotal Discount Amount Is::"; gotoxy(58,12); cout<<d<<" Rs."; cout<<"nNet Amount Is::"; gotoxy(58,13); clrscr(); textcolor(14); gotoxy(30,2); cout<<"***Retail Invoice***"; gotoxy(2,4); cout<<"Customer Name::"; cin>>cn; cout<<"nIdttProduct_NamettRatettDiscount"; while(f1.read((char *)&x,sizeof(x))) { if(x.id==pid) {
  • 25.
    21 | Pa g e cout<<endl<<x.id<<"tt"; cout<<x.n<<"tt"; cout<<x.r<<"tt"; cout<<x.dis<<"%"<<endl; c++; int pqt,multi; cout<<"nEnter a Product Qty:"; cin>>pqt; multi=pqt*x.r; d=multi*pqt*x.dis/100; net=multi-d; cout<<"Bill id is::"; c=autoid(); gotoxy(58,10); cout<<c; cout<<"nTotal Amount Is::"; gotoxy(58,11); cout<<multi<<" Rs."; cout<<"nTotal Discount Amount Is::";
  • 26.
    22 | Pa g e gotoxy(58,12); cout<<d<<" Rs."; cout<<"nNet Amount Is::"; gotoxy(58,13); cout<<net<<" Rs."; break; } } if(c==0) { cout<<"nData NOT Found::"; } f1.close(); }
  • 27.
    23 | Pa g e Thank You Presented By Harsh Mathur Bachelors of Computer Application Dezyne E’cole College, Ajmer
  • 28.
    24 | Pa g e