You are on page 1of 8

9/11/2017 C++ Supermarket Billing Project

.programmingenhance

HOME ABOUT PROGRAMMING ENHANCE COURSES PLACEMENTS DOWNLOADS PROJECT EVENT PROGRAMMING WITH FUN CONTACT US

C++ Supermarket Billing Project SOCIAL PROFILES


10:14 AM C Plus Plus Programs , C++ Project 2 comments

Search
Description: This C++ menu driven programs on SUPERMARKET
BILLING SYSTEM has product class with data members like product Popular Tags Blog Archives
no, product name, price, qty, tax, discount. Product details is stored in a
binary file. A customer can purchase product and his invoice generated.
Administrator can create, modify, view and delete product record.
POST
//*************************************************************** C++ Project ( 37 )
// HEADER FILE USED IN PROJECT
//**************************************************************** C Plus Plus Programs ( 36 )
#include<conio.h>
#include<stdio.h> C Language ( 27 )
#include<process.h>
#include<fstream.h> C# ( 25 )
//***************************************************************
// CLASS USED IN PROJECT Servlet ( 17 )
//****************************************************************
class product Netbeans ( 15 )
{
java ( 13 )
int pno;
char name[50];
JSP ( 10 )
float price,qty,tax,dis;
public: INTERVIEW Question ( 6 )
void create_product()
{ VB.NET ( 6 )
cout<<"\nPlease Enter The Product No. of The Product ";
cin>>pno; ASP.Net ( 4 )
cout<<"\n\nPlease Enter The Name of The Product ";
gets(name); Java 1.6 ( 4 )
cout<<"\nPlease Enter The Price of The Product ";
cin>>price; Swing ( 4 )
cout<<"\nPlease Enter The Discount (%) ";
cin>>dis; jdbc ( 4 )
}
void show_product() Ajax & Json ( 3 )
{
Applet ( 3 )
cout<<"\nThe Product No. of The Product : "<<pno;
cout<<"\nThe Name of The Product : ";
Blogger ( 3 )
puts(name);
cout<<"\nThe Price of The Product : "<<price; Caching ( 3 )
cout<<"\nDiscount : "<<dis;
} Android ( 2 )
http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html 1/8
9/11/2017 C++ Supermarket Billing Project
int retpno()
{return pno;} Download ( 2 )
float retprice()
{return price;} Java Script ( 2 )
char* retname()
{return name;} Layout Manager ( 2 )
int retdis()
{return dis;} Prepared Statement ( 2 )
}; //class ends here
Blogging ( 1 )

//***************************************************************
Callable Statement ( 1 )
// global declaration for stream object, object
//**************************************************************** CookieServlet ( 1 )
fstream fp;
product pr; Database Connectivity ( 1 )
//***************************************************************
// function to write in file Facebook ( 1 )
//****************************************************************
void write_product() Full Screen of turbo C++ in windows vista or
{ windows7 ( 1 )
fp.open("Shop.dat",ios::out|ios::app);
pr.create_product(); Google adsense ( 1 )
fp.write((char*)&pr,sizeof(product));
fp.close(); JNDI ( 1 )
cout<<"\n\nThe Product Has Been Created ";
Programming in C++ ( 1 )
getch();
}
Project report ( 1 )
//***************************************************************
// function to read all records from file Statement ( 1 )
//****************************************************************
void display_all() Struts Tutorial ( 1 )
{
clrscr(); Themes ( 1 )
cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n";
fp.open("Shop.dat",ios::in); VC#.NET ( 1 )
while(fp.read((char*)&pr,sizeof(product)))
{ Wordpress ( 1 )
pr.show_product();
cout<<"\n\n====================================\n"; c(1)
getch();
} oracle jdbc Connection ( 1 )
fp.close();
struts using net beans ( 1 )
getch();
}
struts with data base ( 1 )
//***************************************************************
// function to read specific record from file
//**************************************************************** Dilip Bari. Powered by Blogger.
void display_sp(int n)
{ ABOUT ME
int flag=0;
DI L I P BA RI
fp.open("Shop.dat",ios::in);
while(fp.read((char*)&pr,sizeof(product))) Follow 143
{
V I EW M Y CO M P LET E P R O FI LE
if(pr.retpno()==n)
{
clrscr();
pr.show_product();
TOTAL PAGEVIEWS
flag=1;
}
} 1 4 4 7 2 6
fp.close();
if(flag==0) BLOG ARCHIVE
cout<<"\n\nrecord not exist";
getch(); 2012 ( 148 )
} February ( 109 )
//***************************************************************
// function to modify record of file March ( 38 )
//**************************************************************** Mar 06 ( 4 )
void modify_product() Mar 07 ( 4 )
{
int no,found=0; Mar 08 ( 9 )
clrscr(); Pointer in c language.
cout<<"\n\n\tTo Modify ";
Difference Between C And C++.
http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html 2/8
9/11/2017 C++ Supermarket Billing Project
cout<<"\n\n\tPlease Enter The Product No. of The Product";
C++ BANK MANAGEMENT SYSTEM
cin>>no;
PROJECT
fp.open("Shop.dat",ios::in|ios::out);
while(fp.read((char*)&pr,sizeof(product)) && found==0) C++ LIBRARY MANAGEMENT SYSTEM
{ PROJECT
if(pr.retpno()==no)
C++ STUDENT REPORT CARD
{ SYSTEM
pr.show_product();
cout<<"\nPlease Enter The New Details of Product"<<endl; C++ Supermarket Billing Project
pr.create_product();
C++ HANGMAN GAME PROJECT
int pos=-1*sizeof(pr);
fp.seekp(pos,ios::cur); C++ TIC TAC TOE GAME PROJECT
fp.write((char*)&pr,sizeof(product));
C++ Casino Game Project
cout<<"\n\n\t Record Updated";
found=1;
} Mar 09 ( 2 )
}
Mar 14 ( 5 )
fp.close();
if(found==0) Mar 15 ( 11 )
cout<<"\n\n Record Not Found ";
Mar 18 ( 1 )
getch();
} Mar 20 ( 2 )
//***************************************************************
// function to delete record of file November ( 1 )
//****************************************************************
void delete_product()
{ 2013 ( 21 )
int no;
clrscr();
cout<<"\n\n\n\tDelete Record";
cout<<"\n\nPlease Enter The product no. of The Product You Want To Delete";
cin>>no;
fp.open("Shop.dat",ios::in|ios::out);
fstream fp2;
fp2.open("Temp.dat",ios::out);
fp.seekg(0,ios::beg);
while(fp.read((char*)&pr,sizeof(product)))
{
if(pr.retpno()!=no)
{
fp2.write((char*)&pr,sizeof(product));
}
}
fp2.close();
fp.close();
remove("Shop.dat");
rename("Temp.dat","Shop.dat");
cout<<"\n\n\tRecord Deleted ..";
getch();
}
//***************************************************************
// function to display all products price list
//****************************************************************
void menu()
{
clrscr();
fp.open("Shop.dat",ios::in);
if(!fp)
{
cout<<"ERROR!!! FILE COULD NOT BE OPEN\n\n\n Go To Admin Menu to create
File";
cout<<"\n\n\n Program is closing ....";
getch();
exit(0);
}
cout<<"\n\n\t\tProduct MENU\n\n";
cout<<"====================================================\n";
cout<<"P.NO.\t\tNAME\t\tPRICE\n";
cout<<"====================================================\n";
while(fp.read((char*)&pr,sizeof(product)))
{
cout<<pr.retpno()<<"\t\t"<<pr.retname()<<"\t\t"<<pr.retprice()<<endl;
}

http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html 3/8
9/11/2017 C++ Supermarket Billing Project
fp.close();
}

//***************************************************************
// function to place order and generating bill for Products
//****************************************************************
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============================\n";
do{
cout<<"\n\nEnter The Product No. Of The Product : ";
cin>>order_arr[c];
cout<<"\nQuantity in number : ";
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
\n********************************INVOICE************************\n";
cout<<"\nPr No.\tPr Name\tQuantity \tPrice \tAmount \tAmount after
discount\n";
for(int x=0;x<=c;x++)
{
fp.open("Shop.dat",ios::in);
fp.read((char*)&pr,sizeof(product));
while(!fp.eof())
{
if(pr.retpno()==order_arr[x])
{
amt=pr.retprice()*quan[x];
damt=amt-(amt*pr.retdis()/100);
cout<<"\n"<<order_arr[x]<<"\t"<<pr.retname()
<<"\t"<<quan[x]<<"\t\t"<<pr.retprice()<<"\t"<<amt<<"\t\t"<<damt;
total+=damt;
}
fp.read((char*)&pr,sizeof(product));
}
fp.close();
}
cout<<"\n\n\t\t\t\t\tTOTAL = "<<total;
getch();
}
//***************************************************************
// INTRODUCTION FUNCTION
//****************************************************************
void intro()
{
clrscr();
gotoxy(31,11);
cout<<"SUPER MARKET";
gotoxy(35,14);
cout<<"BILLING";
gotoxy(35,17);
cout<<"PROJECT";
cout<<"\n\nMADE BY : ANUJ KUMAR";
cout<<"\n\nSCHOOL : RYAN INTERNATIONAL SCHOOL";
getch();
}

//***************************************************************
// ADMINSTRATOR MENU FUNCTION
//****************************************************************
void admin_menu()
{
clrscr();

http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html 4/8
9/11/2017 C++ Supermarket Billing Project
char ch2;
cout<<"\n\n\n\tADMIN MENU";
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) ";
ch2=getche();
switch(ch2)
{
case '1': clrscr();
write_product();
break;
case '2': display_all();break;
case '3':
int num;
clrscr();
cout<<"\n\n\tPlease Enter The Product No. ";
cin>>num;
display_sp(num);
break;
case '4': modify_product();break;
case '5': delete_product();break;
case '6': menu();
getch();
case '7': break;
default:cout<<"\a";admin_menu();
}
}
//***************************************************************
// THE MAIN FUNCTION OF PROGRAM
//****************************************************************
void main()
{
char ch;
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) ";
ch=getche();
switch(ch)
{
case '1': clrscr();
place_order();
getch();
break;
case '2': admin_menu();
break;
case '3':exit(0);
default :cout<<"\a";
}
}while(ch!='3');
}
//***************************************************************
// END OF PROJECT
//***************************************************************

Reactions: interesting (0) cool (0)

New er Post Home Older Post

http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html 5/8
9/11/2017 C++ Supermarket Billing Project
2 comments :

kannan smart June 7, 2012 at 5:06 AM


How to get shop.dat file
Reply

Dilip Bari June 25, 2012 at 7:20 AM


Dear Kannan smart,

For example your program location is c:\tc\bin


so you can find shop.dat in c:\tc\bin location.
Reply

Enter your comment...

Comment as: hector triana (G Sign out

Publish Preview Notify me

Links to this post

Create a Link

Subscribe to: Post Comments ( Atom )

Popular Posts
How to Create Project report(Vehicle Management System)
INTRODUCTION Vehicle Management System is software which is helpful for bus
operators, who wants to operate many bus trips in a day. Ve...

Write a program to calculate the total expenses. Quantity and price per item are input
by the user and discount of 10% is offered if the expense is more than 7000.
#include<iostream.h> #include<conio.h> void main() { int totalexp, qty, price, discount;
cout<<" Enter quantit...

C++ LIBRARY MANAGEMENT SYSTEM PROJECT


Description: This C++ menu driven programs on LIBRARY MANAGEMENT SYSTEM has book
and student class with data members like book no, b...

JDBC Demo Login using Netbeans and SQL Server step by step
1.First Create Database and Table in SQL Server create database JavaTest
create table Login ( username varchar(20), user...

Login Demo in jsp with NetBeans & SQL Server


Step 1: Open SQL Server >Create Data Base->Create Table->Insert Value Step
2: Create Data Base create database JavaTest...

C++ BANK MANAGEMENT SYSTEM PROJECT


Description: This C++ programs on BANKING SYSTEM has account class with data members
like account number,name,deposit, withdraw amou...

C++ Supermarket Billing Project


Description: This C++ menu driven programs on SUPERMARKET BILLING SYSTEM has
product class with data members like product no, produc...

C++ STUDENT REPORT CARD SYSTEM

http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html 6/8
9/11/2017 C++ Supermarket Billing Project
Description: This C++ mini project on STUDENT REPORT CARD has student class with data
members like roll no, name, marks and grade. Memb...

WAP to calculate the monthly telephone bills as per the following rule: Minimum Rs.
200 for upto 100 calls. Plus Rs. 0.60 per call for next 50 calls. Plus Rs. 0.50 per call for
next 50 calls. Plus Rs. 0.40 per call for any call beyond 200 calls.
#include<iostream.h> #include<conio.h> void main() { int calls; float bill; cout<<" Enter number
of calls :...

Addition of Two Number using servlet and jsp


index.jsp <%@page contentType="text/html" pageEncoding="UTF-8"%> <!
DOCTYPE HTML PUBLIC "-//W3C//D...

Write a program to calculate the total expenses. Quantity and price per item are input by the
user and discount of 10% is offered if the expense is more than 7000.

C++ Program to define a Class BOOK and accessing member function using its object.

WAP to calculate the monthly telephone bills as per the following rule: Minimum Rs. 200 for
upto 100 calls. Plus Rs. 0.60 per call for next 50 calls. Plus Rs. 0.50 per call for next 50 calls.
Plus Rs. 0.40 per call for any call beyond 200 calls.

C++ STUDENT REPORT CARD SYSTEM

Addition of Two Number using servlet and jsp

C++ Supermarket Billing Project

C++ Program to define a class Batsman and accessing member function using its object.

C++ program to write number 1 to 100 in a data file NOTES.TXT

C++ BANK MANAGEMENT SYSTEM PROJECT

You might also like:-


Caching:Varying the Output Cache By Parameter in ASP.NET
What is Caching in ASP.NET.
While selecting combobox value display the data from database using Ajax and jsp
Check user name available or already exists in database while creating Registration form in jsp
using AJAX like gmail
How to use JSON(JavaScript Object Notation) in NetBeans

Google+ Followers
Dilip Bari
Add to circles

143 have me in circles View all

SUBSCRIBE TO C,C++,JAVA,.NET,STRUTS,HIBERNATE

Posts C Language

http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html 7/8
9/11/2017 C++ Supermarket Billing Project
Comments C# Programs

C++ Programs

Java Programs

Copyright 2017 .programmingenhance | Powered by Blogger

Design by New WpThemes | Blogger Theme by Lasantha - Premium Blogger Themes | sharepoint document management

http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html 8/8

You might also like