Computer Science Project ON: Supermarket Billing System

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 32

COMPUTER SCIENCE

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

This is to certify that A.MOHAMMED JUNAID of


class twelve, Kendriya vidyalaya
Malleshwaram, Bangalore has successfully
completed his project in computer practicals
for the AISSCE as prescribed by CBSE.

Signature of Internal
External
Examiner

__________________

Signature of
Examiner

__________________

ACKNOWLEDGEMENT

I thank my Computer Science teacher Miss.


Neeru Mehandrita for guidance and support. I
also thank my Principal Smt. H D
Bhanumathy. I would also like to thank my
parents for encouraging me during the course
of this project. Finally I would like to thank
CBSE for giving me this opportunity to
undertake this project.

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

and the !uantity of the item he had purchased. This


is not a huge a
task.T h i s s t u d y i s t o p r o d u c e s o f t w a r e w h i c
h m a n a g e s t h e s a l e s a c t i v i t y d o n e i n a sup
ermarket, maintaining the stock details,
maintaining the records of the sales donefor a
particular month"year. The users will consume
less time in calculation and thesales activity will
be completed within a fraction of seconds
whereas manual systemwill make the user to
write it down which is a long procedure and so
paper work will be reduced and the user can
spend more time on the monitoring the supermarket.
The project will be user friendly and easy to use.

HEADER FILES
USED
1.FSTREAM.H- for file handling, cin
and cout.

2:-CONIO.H - for clrscr() and


getch().
3:-STDIO.H- for standard i/o
operations.
4:-PROCESS.H- for exit() function.

WORKING OF THE CODE


This program is designed to maintain a
Supermarket billing system.
This program consists of THREE options in the
Main menu which are as follows.
01.CUSTOMER
02.ADMINISTRATOR
03.EXIT
The Admin Menu consists of SEVEN options
which are as follows.
1.CREATE PRODUCT.
2.DISPLAY ALL PRODUCTS.
3.QUERY.

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);

cout<<"\nEnter The Price of The Product: ";


cin>>price;
cout<<"\nEnter The Discount %: ";
cin>>discount;
}
void show_product()
{
cout<<"\nThe Product No. of The Product : "<<pno;
cout<<"\nThe Name of The Product : ";
puts(name);
cout<<"\nThe Price of The Product : "<<price;
cout<<"\nDiscount : "<<discount;
}
int return_pno()
{return pno;}
float return_price()
{return price;}
char* return_name()
{return name;}
int return_discount()
{return discount;}
};
fstream f;

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();

cout<<"\n\tTo Modify ";


cout<<"\n\tEnter The Product No. of The Product: ";
cin>>no;
f.open("Supermarket.dat",ios::in|ios::out);
while(f.read((char*)&pro,sizeof(product)) && found==0)
{
if(pro.return_pno()==no)
{
pro.show_product();
cout<<"\nEnter The New Details of Product: "<<endl;
pro.create_product();
int pos=-1*sizeof(pro);
f.seekp(pos,ios::cur);
f.write((char*)&pro,sizeof(product));
cout<<"\n\n\t Record Updated";
found=1;
}
}
f.close();
if(found==0)
cout<<"\n\n Record Not Found ";
getch();
}

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");

cout<<"\n\n\tRecord Deleted ..";


getch();
}
void menu()
{
clrscr();
f.open("Supermarket.dat",ios::in);
if(!f)
{
cout<<"ERROR!!! FILE COULD NOT BE OPEN\n\n Go To Admin
Menu to create the file";
cout<<"\n Program is closing ....";
getch();
exit(0);
}
cout<<"\n\t\tProduct MENU\n";
cout<<"P.NO.\t\tNAME\t\tPRICE\n";
cout<<endl;
while(f.read((char*)&pro,sizeof(product)))
{
cout<<pro.return_pno()<<"\t\t"<<pro.return_name()<<"\t\t"<<pro.r
eturn_price()<<endl;
}
f.close();

}
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

6.View product menu

7.Back to main menu

System requirements
Hardware requirements

Processor: Intel core i3 cpu 540 @3.07


GHz 3.06 GHz
RAM:4.00 GB
System Type: 32-bit Operating System
SOFTWARE REQUIREMENTS
Turbo c++
Windows 7

Future scope
Marketers are often interested in attracting
not just brand users, but perhaps more

importantly, those who consistently purchase


the companys brand. In the context of
retailing, this means identifying and attracting
regular visitors and buyers at a retail store.
Using the Data-mining technique of Two-step
clustering, this study, in the context of
grocery shopping, has identified two clusters
from customer data based on loyalty behavior
in order to achieve the first objective.
Prompt service, problem solving, return of
goods and loyalty schemes have always been
important to consumers. Offering loyalty
schemes enables retailers to pre-empt
attractions
from
competitors.
Services
combined with attractive offers can ensure
long term store loyalty.

NOTES

BIBLOGRAPHY
1 http://www.google.com/
2. http://www.cppforschool.com/project/supermarket-billing.html
3 Computer Science with C++ by Sumita
Arora.

You might also like