Professional Documents
Culture Documents
Supermarket Billing System in C++
Supermarket Billing System in C++
A
PROJECT REPORT ON
CERTIFICATE
Place- Belhe
Date-
lOMoARcPSD|204 061 89
TABLE OF CONTENTS
ABSTRACT v
1 INTRODUCTION 1
1.1 INTRODUCTION 1
1.2 SCOPE OF THE WORK 6
1.3 PROBLEM STATEMENT 7
1.4 AIM AND OBJECTIVES OF THE PROJECT 8
2 SYSTEM SPECIFICATIONS
2.1 HARDWARE SPECIFICATIONS 17
2.2 SOFTWARE SPECIFICATIONS 17
3 MODULE DESCRIPTION 18
4 SYSTEM DESIGN 20
4.1 ARCHITECTURE DIAGRAM 20
4.2 DATA FLOW DIAGRAM 21
5 CODING 24
6 SCREEN SHOTS 39
7 CONCLUSION 44
REFERENCES 45
lOMoARcPSD|204 061 89
ABSTRACT
pertaining to customer. The product will help the user to work in a highly
energy that could be utilized in the better productive activities. Apart from that,
automation deals with all such problems and tries to remove them in the best
suitable fashion. The new system will cater to the need of the sales persons of
CHAPTER 1
1.1 INTRODUCTION
1
lOMoARcPSD|204 061 89
FEASIBILITY STUDY
(1) The Project Scope -which is used to define the business problem and/or
opportunity to be addressed. The old adage, "The problem well stated is half
solved," is very apropos. The scope should be definitive and to the point;
rambling narrative serves no purpose and can actually confuse project
participants.
(2) The Current Analysis -is used to define and understand the current method
of implementation, such as a system, a product, etc. From this analysis, it is not
uncommon to discover there is actually nothing wrong with the current system
or product other than some misunderstandings regarding it or perhaps it needs
some simple modifications as opposed to a major overhaul.
(3) Requirements - how requirements are defined depends on the object of the
project's attention. For example, how requirements are specified for a product is
2
lOMoARcPSD|204 061 89
(5) Evaluation - examines the cost effectiveness of the approach selected. This
begins with an analysis of the estimated total cost of the project. (6) Review - all
of the preceding elements are then assembled into a Feasibility Study and a
formal review is conducted with all parties involved.
There are 5 types of the feasibilities which are discussed here. These are as
follows:
Front-End Selection: Front-End means a language that is used for user interface
designing and coding. Front-End should have following qualities:
It must have a graphical user interface that assist employees that are not
from some IT background.
Scalability and Extensibility
Robustness
According to the organization requirements and culture.
Must provide excellent reporting features with good printing support.
3
lOMoARcPSD|204 061 89
Platform independent.
Easy to deploy and maintain.
Event driven programming.
2. Economical Feasibility:
3. Operational Feasibility:
In the new system we made some major changes for the staff members so that
they have to be trained to use the newly added facilities. These major changes
are possible and give a new era in the Supermarket in production and sales
management.
4. Schedule Feasibility:
4
lOMoARcPSD|204 061 89
5. Behavioral Feasibility:
People are inherently resisted to change and a computer means “change is the
only certainty”. An estimate should be made of how strong a reaction the user
staff in going to have towards development of new system. Thus special efforts
can be made to educate and train the staff.
5
lOMoARcPSD|204 061 89
Scope of this project is to investigate and design a software solution which can
facilitate both customer and salesperson in performing their daily tasks,
improving efficiency, and helping them to be more productive. This project will
provide a solution through which salesperson can easily manage, handle and
generate all required information in their respective format when needed. It
provides quick way of operation by capturing the manual process and
automating them. It will help them to manage the bill details, financial data, and
historical data and also in producing documents of different formats for
different customers. This solution will help salesperson in reducing effort spend
on managing many bills. It will also provide them opportunity to explore
possibility of generating documents, managing financial details. This system
will help the salesperson to manage in fast billing. It will help to maintain the
data of the purchased items. It also gives bill to the customers. It will set the
rates of taxes and commission on products. The project will enable to see the
report regarding product and category in a fixed period of time. It can also
change the Graphical User interface of the system.
6
lOMoARcPSD|204 061 89
In today’s fast paced society, it’s very hard to be competitive without using
cutting-edge technology available in market. After years of business, the data
has grown much. It is becoming a challenge for person to manage that data in an
effective way. To be more productive in order processing, he needs a solution
which can facilitate their current processes with use of technology and software.
With increased amount of orders, it is becoming difficult for salesperson to
manage orders in effective and efficient manner. It is very hard to go through all
paper work and backtracking orders. If there is any complain or review of any
order, it takes large amount of effort and time to backtrack and fix the problem.
This results in loss of resources, increased time, and low output.
AIM:
To make software fast in processing, with good user interface so that user can
change it and it should be used for a long time without error and maintenance.
OBJECTIVES:
gives them more commission. It also shows the overall profit and profit on a
particular product and give repots which items are required and which have
cross their expiry date.
Converts the manual work which is time consuming and error prone to
fully automated system.
Helps in eliminating the paper work ,saves time and improves customer
services.
Makes the addition of items in the bill, deletion of items and
modification of items in the bill easier and faster.
C++ has supported to implement object oriented concepts.
Bills can be calculated more easily and with more accuracy.
Reduces pressure on the labor.
Makes the system more feasible and flexible and thus retrieval of
information becomes convenient.
10
lOMoARcPSD|204 061 89
object can be accessed only by the function associated with that object.
However, function of one object can access the function of other objects.
• Emphasis is on data rather than procedure. • Programs are divided into what
are known as objects. • Data structures are designed such that they characterize
the objects. • Functions that operate on the data of an object are ties together in
the data structure. • Data is hidden and cannot be accessed by external function.
• Objects may communicate with each other through function. • New data and
functions can be easily added whenever necessary. • Follows bottom up
approach in program design. Object-oriented programming is the most recent
concept among programming paradigms and still means different things to
different people.
These include:
• Objects
• Classes
• Data abstraction and encapsulation
• Inheritance
• Polymorphism
• Dynamic binding
• Message passing
11
lOMoARcPSD|204 061 89
Objects:
Objects are the basic run time entities in an object-oriented system. They may
represent a person, a place, a bank account, a table of data or any item that the
program has to handle. They may also represent user-defined data such as
vectors, time and lists. Programming problem is analyzed in term of objects and
the nature of communication between them. Program objects should be chosen
such that they match closely with the real-world objects. Objects take up space
in the memory and have an associated address like a record in Pascal, or a
structure in c.
Classes :
We just mentioned that objects contain data, and code to manipulate that data.
The entire set of data and code of an object can be made a user-defined data
type with the help of class. In fact, objects are variables of the type class. Once
a class has been defined, we can create any number of objects belonging to that
class. Each object is associated with the data of type class with which they are
created. A class is thus a collection of objects similar types.
The wrapping up of data and function into a single unit (called class) is known
as encapsulation. Data and encapsulation is the most striking feature of a class.
The data is not accessible to the outside world, and only those functions which
are wrapped in the class can access it. These functions provide the interface
between the object’s data and the program. This insulation of the data from
direct access by the program is called data hiding or information hiding.
Abstraction refers to the act of representing essential features without including
the background details or explanation. Classes use the concept of abstraction
12
lOMoARcPSD|204 061 89
and are defined as a list of abstract attributes such as size, wait, and cost, and
function operate on these attributes. They encapsulate all the essential properties
of the object that are to be created. The attributes are some time called data
members because they hold information. The functions that operate on these
data are sometimes called methods or member function.
Inheritance:
An inherited class is called a subclass of its parent class or super class. The term
"inheritance" is loosely used for both class-based and prototype-based
programming, but in narrow use the term is reserved for class-based
programming (one class inherits from another), with the corresponding
technique in prototype-based programming being instead called delegation (one
object delegates to another).
13
lOMoARcPSD|204 061 89
Polymorphism :
Dynamic Binding :
Message Passing :
14
lOMoARcPSD|204 061 89
File Concepts:
The I/O system of C++ handles file operations which are very much similar to
the console input and output operations .It uses file streams as an interface
between the programs and files. The stream that supplies data to the program is
called input stream and the one that receives data from the program is called
output stream. In other words input stream extracts data from the file and output
stream inserts data to the file. The input operation involves the creation of an
input stream and linking it with the program and input file. Similarly, the output
operation involves establishing an output stream with the necessary links with
the program and output file.
filebuf :Its purpose is to set the file buffers to read and write. Contains
Open prompt constant used in the open() of file stream classes. Also
contain close() and open() as members.
15
lOMoARcPSD|204 061 89
Parameter Meaning
16
lOMoARcPSD|204 061 89
CHAPTER 2
SYSTEM SPECIFICATIONS
RAM : 8GB(Minimum)
HDD : 40GB(Minimum)
17
CHAPTER 3
MODULE DESCRIPTION
1)Login -Id
Module 1: Login–Id: This module is made for the login of users. We know that
we have 3 users so login-id is for:
1. Administrator
18
lOMoARcPSD|204 061 89
This module is also for the administrator who can generate or check the report
of the product and how many products are sold on particular date or in a period
of time.
2. Print it.
19
lOMoARcPSD|204 061 89
CHAPTER 4
SYSTEM DESIGN
4.1ARCHITECTURE DIAGRAM
20
lOMoARcPSD|204 061 89
21
lOMoARcPSD|204 061 89
22
lOMoARcPSD|204 061 89
23
lOMoARcPSD|204 061 89
CHAPTER 5
CODING
#include<iostream>
#include<windows.h>
#include<conio.h>
#include<fstream>
#include<cstring>
#include<cstdio>
#include<cstdlib>
#include<iomanip>
using namespace std;
//global variable declaration
int k=7,r=0,flag=0;
COORD coord = {0, 0};
ofstream fout;
ifstream fin;
class item
int itemno;
24
lOMoARcPSD|204 061 89
char name[25];
date d;public:
void add()
{
cout<<"\n\n\tItem No: ";
cin>>itemno;
cout<<"\n\n\tName of the item: ";
cin>>name;
//gets(name);
cout<<"\n\n\tManufacturing Date(dd-mm-yy): ";
cin>>d.mm>>d.dd>>d.yy;
}
void show()
{
cout<<"\n\tItem No: ";
cout<<itemno;
cout<<"\n\n\tName of the item: ";
cout<<name;
cout<<"\n\n\tDate : ";
cout<<d.mm<<"-"<<d.dd<<"-"<<d.yy;
}
void report()
{
gotoxy(3,k);
cout<<itemno;
gotoxy(13,k);
puts(name);
25
lOMoARcPSD|204 061 89
}
intretno()
{
return(itemno);
};
void amount::add()
{
item::add();
cout<<"\n\n\tPrice: ";
cin>>price;
26
lOMoARcPSD|204 061 89
cout<<"\n\n\tQuantity: ";
cin>>qty;
cout<<"\n\n\tTax percent: ";
cin>>tax;
cout<<"\n\n\tDiscount percent: ";
cin>>dis;
calculate();
fout.write((char *)&amt,sizeof(amt));
fout.close();
}
void amount::calculate()
{
gross=price+(price*(tax/100));
netamt=qty*(gross-(gross*(dis/100)));
}
void amount::show()
{
fin.open("itemstore.dat",ios::binary);
fin.read((char*)&amt,sizeof(amt));
item::show();
cout<<"\n\n\tNet amount: ";
cout<<netamt;
fin.close();
}
void amount::report()
{
item::report();
gotoxy(23,k);
27
lOMoARcPSD|204 061 89
cout<<price;
gotoxy(33,k);
cout<<qty;
gotoxy(44,k);
cout<<tax;
gotoxy(52,k);
cout<<dis;
gotoxy(64,k);
cout<<netamt;
k=k+1;
if(k==50)
{
gotoxy(25,50);
cout<<"PRESS ANY KEY TO CONTINUE...";
getch();
k=7;
system("cls");
gotoxy(30,3);
cout<<" ITEM DETAILS ";
gotoxy(3,5);
cout<<"NUMBER";
gotoxy(13,5);
cout<<"NAME";
gotoxy(23,5);
cout<<"PRICE";
gotoxy(33,5);
cout<<"QUANTITY";
gotoxy(44,5);
cout<<"TAX";
28
lOMoARcPSD|204 061 89
gotoxy(52,5);
cout<<"DEDUCTION";
gotoxy(64,5);
cout<<"NET AMOUNT";
}
}
void amount::pay()
{
show();
cout<<"\n\n\n\t\t*********************************************";
cout<<"\n\t\t DETAILS ";
cout<<"\n\t\t*********************************************";
cout<<"\n\n\t\tPRICE :"<<price;
cout<<"\n\n\t\tQUANTITY :"<<qty;
cout<<"\n\t\tTAX PERCENTAGE :"<<tax;
cout<<"\n\t\tDISCOUNT PERCENTAGE :"<<dis;
cout<<"\n\n\n\t\tNET AMOUNT :Rs."<<netamt;
cout<<"\n\t\t*********************************************";
}
int main()
{
cout.setf(ios::fixed);
cout.setf(ios::showpoint);
cout<<setprecision(2);
fstreamtemp("temp.dat",ios::binary|ios::out)
; menu:
system("cls");
29
lOMoARcPSD|204 061 89
gotoxy(25,2);
cout<<"Super Market Billing ";
gotoxy(25,3);
cout<<"===========================\n\n";
cout<<"\n\t\t1.Bill Report\n\n";
cout<<"\t\t2.Add/Remove/Edit Item\n\n";
cout<<"\t\t3.Show Item Details\n\n";
cout<<"\t\t4.Exit\n\n";
cout<<"\t\tPlease Enter Required Option: ";
intch,ff;
float gtotal;
cin>>ch;
switch(ch)
{
case 1:
ss:
system("cls");
gotoxy(25,2);
cout<<"Bill Details";
gotoxy(25,3);
cout<<"================\n\n";
cout<<"\n\t\t1.All Items\n\n";
cout<<"\t\t2.Back to Main menu\n\n";
cout<<"\t\tPlease Enter Required Option: ";
intcho;
cin>>cho;
if(cho==1)
{
system("cls");
30
lOMoARcPSD|204 061 89
gotoxy(30,3);
cout<<" BILL DETAILS ";
gotoxy(3,5);
cout<<"ITEM NO";
gotoxy(13,5);
cout<<"NAME";
gotoxy(23,5);
cout<<"PRICE";
gotoxy(33,5);
cout<<"QUANTITY";
gotoxy(44,5);
cout<<"TAX %";
gotoxy(52,5);
cout<<"DISCOUNT %";
gotoxy(64,5);
cout<<"NET AMOUNT";
fin.open("itemstore.dat",ios::binary);
if(!fin)
{
cout<<"\n\nFile Not Found...";
goto menu;
}
fin.seekg(0);
gtotal=0;
while(!fin.eof())
{
fin.read((char*)&amt,sizeof(amt));
if(!fin.eof())
{
31
lOMoARcPSD|204 061 89
amt.report();
gtotal+=amt.retnetamt();
ff=0;
}
if(ff!=0) gtotal=0;
}
gotoxy(17,k);
cout<<"\n\n\n\t\t\tGrand Total="<<gtotal;
getch();
fin.close();
}
if(cho==2)
{
goto menu;
}
gotoss;
case 2:
db:
system("cls");
gotoxy(25,2);
cout<<"Bill Editor";
gotoxy(25,3);
cout<<"=================\n\n";
cout<<"\n\t\t1.Add Item Details\n\n";
cout<<"\t\t2.Edit Item Details\n\n";
cout<<"\t\t3.Delete Item Details\n\n";
cout<<"\t\t4.Back to Main Menu ";
int apc;
cin>>apc;
32
lOMoARcPSD|204 061 89
switch(apc)
{
case 1:
fout.open("itemstore.dat",ios::binary|ios::app);
amt.add();
cout<<"\n\t\tItem Added Successfully!";
getch();
gotodb;
case 2:
intino;
flag=0;
cout<<"\n\n\tEnter Item Number to be Edited :";
cin>>ino;
fin.open("itemstore.dat",ios::binary);
fout.open("itemstore.dat",ios::binary|ios::app);
if(!fin)
{
cout<<"\n\nFile Not Found...";
goto menu;
}
fin.seekg(0);
r=0;
while(!fin.eof())
{
fin.read((char*)&amt,sizeof(amt));
if(!fin.eof())
{
int x=amt.item::retno();
33
lOMoARcPSD|204 061 89
if(x==ino)
{
flag=1;
fout.seekp(r*sizeof(amt));
system("cls");
cout<<"\n\t\tCurrent Details are\n";
amt.show();
cout<<"\n\n\t\tEnter New Details\n";
amt.add();
cout<<"\n\t\tItem Details editted";
}
}
r++;
}
if(flag==0)
{
cout<<"\n\t\tItem No does not exist...Please Retry!";
getch();
gotodb;
}
fin.close();
getch();
gotodb;
case 3:
flag=0;
cout<<"\n\n\tEnter Item Number to be deleted :";
cin>>ino;
fin.open("itemstore.dat",ios::binary);
34
lOMoARcPSD|204 061 89
if(!fin)
{
cout<<"\n\nFile Not Found...";
goto menu;
}
//fstreamtemp("temp.dat",ios::binary|ios::out);
fin.seekg(0);
while(fin.read((char*)&amt, sizeof(amt)))
{
int x=amt.item::retno();
if(x!=ino)
temp.write((char*)&amt,sizeof(amt)
);
else
{
flag=1;
}
}
fin.close();
temp.close();
fout.open("itemstore.dat",ios::trunc|ios::binary);
fout.seekp(0);
temp.open("temp.dat",ios::binary|ios::in);
if(!temp)
{
cout<<"Error in File";
gotodb;
}
while(temp.read((char*)&amt,sizeof(amt)))
fout.write((char*)&amt,sizeof(amt));
35
lOMoARcPSD|204 061 89
temp.close();
fout.close();
if(flag==1)
cout<<"\n\t\tItemSuccesfully Deleted";
else if (flag==0)
cout<<"\n\t\tItem does not Exist! Please Retry";
getch();
gotodb;
case 4:
goto menu;
default:
cout<<"\n\n\t\tWrong Choice!!! Retry";
getch();
gotodb;
}
case 3:
system("cls");
flag=0;
intino;
cout<<"\n\n\t\tEnter Item Number :";
cin>>ino;
fin.open("itemstore.dat",ios::binary);
if(!fin)
{
cout<<"\n\nFile Not Found...\nProgram Terminated!";
goto menu;
}
fin.seekg(0);
while(fin.read((char*)&amt,sizeof(amt)))
36
lOMoARcPSD|204 061 89
{
int x=amt.item::retno();
if(x==ino)
{
amt.pay();
flag=1;
break;
}
}
if(flag==0)
cout<<"\n\t\tItem does not exist ... Please Retry!";
getch();
fin.close();
goto menu;
case 4:
system("cls");
gotoxy(20,20);
cout<<"ARE YOU SURE, YOU WANT TO EXIT (Y/N)?";
char yn;
cin>>yn;
if((yn=='Y')||(yn=='y'))
{
gotoxy(12,20);
system("cls");
cout<<"************************** THANKS
**************************************";
getch();
exit(0);
}
37
lOMoARcPSD|204 061 89
else if((yn=='N')||(yn=='n'))
goto menu
else
{
goto menu;
}
default:
cout<<"\n\n\t\tWrong Choice. .. Please Retry!";
getch();
goto menu;
return 0;
}
38
lOMoARcPSD|204 061 89
CHAPTER 6
SCREEN SHOTS
39
lOMoARcPSD|204 061 89
2) It shows that a billing system operator can add item details, edit the item details,
delete the item details and go back to main menu.
40
lOMoARcPSD|204 061 89
41
lOMoARcPSD|204 061 89
4) If we delete an item that does not exist in the system it shows an error.
42
lOMoARcPSD|204 061 89
43
lOMoARcPSD|204 061 89
CHAPTER 7
CONCLUSION
This software has been developed designed to reduce the time taken to handle the
sales activity. It is designed to replace an existing manual record system for reducing
time taken for calculations and for storing data. This system has been developed with
oops concepts.The system is strong to handle daily operations where the database is
cleared over certain time. This system will reduce manual work, calculations and will
also provide periodic reports any time.
44
lOMoARcPSD|204 061 89
REFERENCES
1. http://www.bestprojectsidea.com/vb-6-0-synopsis/supermarket-billing-
system/.
2. http://www.scribd.com/doc/27828662/ABSTRACT-the-Project-supermarket-
Deals-With-The.
3. http://www.memoireonline.com/07/12/5995/Online-ordering-and-
supermarket-system.html.
4. http://www.scribd.com/doc/37762263/Online-Supermarket-System.
5.http://pdfebooklibrary.com/pdf/all-uml-diagrams-for-supermarket-billing-
system.pdf.
45