9/11/2017
C+ + Super mar ket Bi ll i ng Pr oj ect
.
HOME
ABOU T PROGRAMMING ENHANCE
COU RS RS ES ES »
PLACEMENTS »
DOW DO WNLOADS
PROJ ECT
EVENT »
C++ Supermarket Billing Project 10:14 AM
C Plus Plus Programs , C++ Project
PROGRAMMING PROGR AMMING WITH FU N »
CONTACT US
SOCIAL PROFILES
2 comm ents
Description: This C++ menu driven programs on SUPERMARKET Description: This BILLING SYSTEM has product class with data members like product no, product name, price, qty, tax, discount. Product details is stored in a binary file. file . A customer customer can purchase product and his invoice generated. Administrator Adm inistrator can create, create, modify modify,, view and delete delete product record.
Search Popular
Tags
Blog Archives
POST //************************************************************* //*************************************** ************************ ** // HEADER FILE USED IN PROJECT //*************************************** //****************** ******************************************* ************************* *** #include
#include #include #include //*************************************** //****************** ******************************************* ************************ ** // CLASS USED IN PROJECT //*************************************** //****************** ******************************************* ************************* *** class product class product { int pno; int pno; char name[50]; char name[50]; float price,qty,tax,dis; float price,qty,tax,dis; public: public : void create_product() void create_product() { cout<<"\nPlease cout<<" \nPlease Enter The Product No. of The Product "; cin>>pno; cout<<"\n\nPlease cout<<" \n\nPlease Enter The Name of The Product "; gets(name); cout<<"\nPlease cout<<" \nPlease Enter The Price of The Product "; cin>>price; cout<<"\nPlease cout<<" \nPlease Enter The Discount (%) "; cin>>dis; } void show_product() void show_product() { cout<<"\nThe cout<<" \nThe Product No. of The Product : "<
C++ Project ( 37 ) C Plus Plus Programs ( 36 ) C Language ( 27 ) C# ( 25 ) Servlet ( 17 ) Netbeans ( 15 ) java jav a ( 13 ) JSP ( 10 ) INTERVIEW Question ( 6 ) VB.NET ( 6 ) ASP.Net ( 4 ) Java 1.6 ( 4 ) Swing ( 4 ) jdbc ( 4 ) Ajax & Json ( 3 ) Applet ( 3 ) Blogger ( 3 ) Caching ( 3 ) Android ( 2 )
1/8
9/11/2017
C++ Supermarket Billing Project
int retpno() {return pno;} float retprice() {return price;} char* retname() {return name;} int retdis() {return dis;} }; //class ends here //*************************************************************** // global declaration for stream object, object //**************************************************************** fstream fp; product pr; //*************************************************************** // function to write in file //**************************************************************** void write_product() { fp.open("Shop.dat",ios::out|ios::app); pr.create_product(); fp.write((char*)&pr,sizeof(product)); fp.close(); cout<<"\n\nThe Product Has Been Created "; getch(); } //*************************************************************** // function to read all records from file //**************************************************************** void display_all() { clrscr(); cout<<"\n\n\n\t\tDISPLAY ALL RECORD !!!\n\n "; fp.open("Shop.dat",ios::in); while(fp.read((char*)&pr,sizeof(product))) { pr.show_product(); cout<<"\n\n====================================\n"; getch(); } fp.close(); getch(); } //*************************************************************** // function to read specific record from file //**************************************************************** void display_sp(int n) { int flag=0; fp.open("Shop.dat",ios::in); while(fp.read((char*)&pr,sizeof(product))) { if(pr.retpno()==n) { clrscr(); pr.show_product(); flag=1; } } fp.close(); if(flag==0) cout<<"\n\nrecord not exist "; getch(); } //*************************************************************** // function to modify record of file //**************************************************************** void modify_product() { int no,found=0; clrscr(); cout<<"\n\n\tTo Modify "; http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html
Download ( 2 ) Java Script ( 2 ) Layout Manager ( 2 ) Prepared Statement ( 2 ) Blogging ( 1 ) Callable Statement ( 1 ) CookieServlet ( 1 ) Database Connectivity ( 1 ) Facebook ( 1 ) Full Screen of turbo C++ in windows vista or windows7 ( 1 ) Google adsense ( 1 ) JNDI ( 1 ) Programming in C++ ( 1 ) Project report ( 1 ) Statement ( 1 ) Struts Tutorial ( 1 ) Themes ( 1 ) VC#.NET ( 1 ) Wordpress ( 1 ) c(1) oracle jdbc Connection ( 1 ) struts using net beans ( 1 ) struts with data base ( 1 ) Dilip Bari. P owered by Blogger.
ABOUT ME DILIP BARI
Follow
143
VIEW M Y COMPLETE PROFILE
TOTAL PAGEVIEWS
1 4 4 7 2 6 BLOG ARCHIVE ▼ 2012 ( 148 ) ► February ( 109 ) ▼ March ( 38 ) ► Mar 06 ( 4 ) ► Mar 07 ( 4 ) ▼ Mar 08 ( 9 ) Pointer in c language. Difference Between C And C++.
2/8
9/11/2017
C++ Supermarket Billing Project
cout<<"\n\n\tPlease Enter The Product No. of The Product "; cin>>no; fp.open("Shop.dat",ios::in|ios::out); while(fp.read((char*)&pr,sizeof(product)) && found==0) { if(pr.retpno()==no) { pr.show_product(); cout<<"\nPlease Enter The New Details of Product "<>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<
C++ BANK MANAGEMENT SYSTEM PROJECT C++ LIBRARY MANAGEMENT SYSTEM PROJECT C++ S TUDENT REPORT CARD SYSTEM C++ Supermarket Billing Project C++ HANGMAN GAME PROJECT C++ TIC TAC TOE GAME PROJECT C++ Casino Game Project ► Mar 09 ( 2 ) ► Mar 14 ( 5 ) ► Mar 15 ( 11 ) ► Mar 18 ( 1 ) ► Mar 20 ( 2 ) ► November ( 1 ) ► 2013 ( 21 )
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"<
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:
New er Post
Home
http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html
Older Post
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:
Publish
hector triana (
Preview
Sign out
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 ex pense is more than 7000. #include #include void main() { int totalexp, qty, price, discount; cout<<" Enter quantit... C++ LIBRARY MANAGEMENT SYSTEM PROJECT Description: This C++ menu driven programs on LIBRARY MANAGEME NT 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.Firs t 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 acc ount number,name,deposit, withdraw amou... C++ Supermarket Billing Project Description: This C++ menu driven programs on SUPERMA RKET BILLING SYSTEM has product c lass 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++ m ini project on STUDENT REPORT CARD has st udent class with data members like roll no, name, m arks 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 #include void main() { int calls; float bill; cout<< " Enter number of calls :... Addition of Two Numbe r using servlet and j sp index.jsp <% @page contentType="text /html" pageEncoding="UTF-8"%>
Write a program to calculate the total expenses. Quantity and price per item are input by t he user and discount of 10% is offered if the expense is more than 7000. C++ P rogram to define a Class BOOK and accessing member function using its object. WAP to calculate t he 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 c all 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 s electing combobox value display the data from database using A jax 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
SUBSCRIBE TO Posts
http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html
View all
C,C++,JAVA,.NET,STRUTS,HIBERNATE C Language
7/8
9/11/2017
C++ Supermarket Billing Project C# Programs
Comments
C++ P rograms Java Programs
Copyright © 2017 .programmingenhance | Powered by Blogger
Design by New WpThemes | Blogger Theme by Lasa ntha - Premium Blogger Themes | sharepo int document management
http://programmingenhance.blogspot.com.co/2012/03/c-supermarket-billing-project.html
8/8