Computer Science Project ON: Supermarket Billing System
Computer Science Project ON: Supermarket Billing System
Computer Science Project ON: Supermarket Billing System
PROJECT
ON
SUPERMARKET BILLING
SYSTEM
A Mohammed junaid
Class:- XII B
Roll no.4620151
KENDRIYA VIDYALAYA
MALLESHWARAM
TABLE OF
CONTENTS
1.Certificate
2.Acknowledgement
3.introduction
4.Header files used
5.Working of the code
6.Code
7.Output
8.system requirements
9.future scope
10.Biblography
CERTIFICATE
Signature of Internal
External
Examiner
__________________
Signature of
Examiner
__________________
ACKNOWLEDGEMENT
A
Mohammed junaid
INTRODUCTION
Supermarket management system is the system
where all the aspects related to
the proper management of supermarket is done. Th
ese aspects involve managinginformation about
the various products, staff, managers,
customers, billing etc. Thissystem provides an
efficient way of managing the supermarket
information. Alsoallows the customer to purchase
and pay for the items purchased.This project is
based on the sales transaction and billing of
items in a supermarket.The first activity is based
on adding the items to the system along with the
rate whichare present in the supermarket and
the name of the items which the supermarket
willagree to sell. This authority is given only to
admin (administrator). Any modificationsto be done
in the item name and the rate can be done only
by admin. e also has theright to delete any
item. As the customer buys the products and
comes to the billingcounter, the user is
supposed to enter the item name he purchased
HEADER FILES
USED
1.FSTREAM.H- for file handling, cin
and cout.
4.MODIFY PRODUCT.
5.DELETE PRODUCT.
6.VIEW PRODUCT MENU
7.BACK TO MAIN MENU
CODE
#include<fstream.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
class product
{
int pno;
char name[50];
float price,qty,tax,discount;
public:
void create_product()
{
cout<<"\nEnter The Product No. of The Product: ";
cin>>pno;
cout<<"\nEnter The Name of The Product: ";
gets(name);
product pro;
void write_product()
{
f.open("Supermarket.dat",ios::out|ios::app);
pro.create_product();
f.write((char*)&pro,sizeof(product));
f.close();
cout<<"\n\nThe Product Has Been Created ";
getch();
}
void display_all()
{
clrscr();
cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n";
f.open("Supermarket.dat",ios::in);
while(f.read((char*)&pro,sizeof(product)))
{
pro.show_product();
cout<<"\n";
getch();
}
f.close();
getch();
}
void display_sp(int n)
{
int flag=0;
f.open("Supermarket.dat",ios::in);
while(f.read((char*)&pro,sizeof(product)))
{
if(pro.return_pno()==n)
{
clrscr();
pro.show_product();
flag=1;
}
}
f.close();
if(flag==0)
cout<<"\nrecord not exist";
getch();
}
void modify_product()
{
int no,found=0;
clrscr();
void delete_product()
{
int no;
clrscr();
cout<<"\n\n\tDelete Record";
cout<<"\n\nEnter The product no. of The Product You Want To
Delete: ";
cin>>no;
f.open("Supermarket.dat",ios::in|ios::out);
fstream f1;
f1.open("Temp.dat",ios::out);
f.seekg(0,ios::beg);
while(f.read((char*)&pro,sizeof(product)))
{
if(pro.return_pno()!=no)
{
f1.write((char*)&pro,sizeof(product));
}
}
f1.close();
f.close();
remove("Supermarket.dat");
rename("Temp.dat","Supermarket.dat");
}
void place_order()
{
int order_arr[50],quan[50],c=0;
float amt,damt,total=0;
char ch='Y';
menu();
cout<<"\n";
cout<<"\n PLACE YOUR ORDER";
cout<<"\n";
do{
cout<<"\nEnter The Product No. Of The Product : ";
cin>>order_arr[c];
cout<<"\nQuantity : ";
cin>>quan[c];
c++;
cout<<"\nDo You Want To Order Another Product ? (y/n)";
cin>>ch;
}while(ch=='y' ||ch=='Y');
cout<<"\n\nThank You For Placing The Order";getch();clrscr();
cout<<"\n";
cout<<"\nPr No.\tPr Name\tQuantity \tPrice \tAmount \tAmount of
Discount\n";
for(int x=0;x<=c;x++)
{
f.open("Supermarket.dat",ios::in);
f.read((char*)&pro,sizeof(product));
while(!f.eof())
{
if(pro.return_pno()==order_arr[x])
{
amt=pro.return_price()*quan[x];
damt=amt-(amt*pro.return_discount()/100);
cout<<"\n"<<order_arr[x]<<"\t"<<pro.return_name()
<<"\t"<<quan[x]<<"\t\t"<<pro.return_price()<<"\t"<<amt<<"\t"<<da
mt;
total+=damt;
}
f.read((char*)&pro,sizeof(product));
}
f.close();
}
cout<<"\n\n\t\tTOTAL = "<<total;
getch();
}
void intro()
{
clrscr();
cout<<"\n\n\n\n\n\n\t\t\t\tSUPER MARKET";
cout<<"\n\n\n\n\n\n\n\t\t\t\t\tBILLING SYSTEM";
getch();
}
void admin_menu()
{
clrscr();
char ch;
cout<<"\t\t\t\tADMIN MENU\t\t\t\t";
cout<<"\n\n\t1.CREATE PRODUCT";
cout<<"\n\n\t2.DISPLAY ALL PRODUCTS";
cout<<"\n\n\t3.QUERY ";
cout<<"\n\n\t4.MODIFY PRODUCT";
cout<<"\n\n\t5.DELETE PRODUCT";
cout<<"\n\n\t6.VIEW PRODUCT MENU";
cout<<"\n\n\t7.BACK TO MAIN MENU";
cout<<"\n\n\tPlease Enter Your Choice (1-7) ";
ch=getche();
switch(ch)
{
case '1': clrscr();
write_product();
break;
case '2': display_all();break;
case '3':
int num;
clrscr();
cout<<"\n\n\tEnter The Product No: ";
cin>>num;
display_sp(num);
break;
case '4': modify_product();break;
case '5': delete_product();break;
case '6': menu();break;
getch();
case '7': break;
default:cout<<"\a";admin_menu();
}
}
void main()
{
char che;
intro();
do
{
clrscr();
cout<<"\n\n\n\tMAIN MENU";
cout<<"\n\n\t01. CUSTOMER";
cout<<"\n\n\t02. ADMINISTRATOR";
cout<<"\n\n\t03. EXIT";
cout<<"\n\n\tPlease Select Your Option (1-3) ";
che=getche();
switch(che)
{
case '1': clrscr();
place_order();
getch();
break;
case '2': admin_menu();
break;
case '3':exit(0);
default :cout<<"\a";
}
}while(che!='3');
}
Input screenshots
Main menu
Product menu
Admin menu
OUTPUT SCREENSHOTS
1.Create Product
2.Display
3.Query
4.Modify
5.Delete
System requirements
Hardware requirements
Future scope
Marketers are often interested in attracting
not just brand users, but perhaps more
NOTES
BIBLOGRAPHY
1 http://www.google.com/
2. http://www.cppforschool.com/project/supermarket-billing.html
3 Computer Science with C++ by Sumita
Arora.