Shopping mall

67 %
33 %
Information about Shopping mall

Published on February 15, 2014

Author: pranav_gh

Source: slideshare.net

PROJECT PREPARED BY: PRANAV GHILDIYAL XII B Session: 2013-2014 KENDRIYA VIDYALAYA B.E.G 1

TABLE OF CONTENTS Serial Number Topic 1 Certificate 2 Acknowledgement 3 Header files and their purpose 4 Coding 5 Limitations 6 Requirements 7 Bibliography 2 Page Number

Acknowledgement I thank my Computer Science teacher Mr. Murli Manohar for guidance and support. I also thank my Principal Ms. N. Geeta Rao. I would also like to thank my parents for encouraging me during the whole course of this project. Finally I would like to thank CBSE for giving me such opportunity to undertake this esteem project. 3

Certificate This is to certify that PRANAV GHILDIYAL of class XII B, KENDRIYA VIDYALAYA B.E.G has successfully completed his project in computer practicals for the AISSCE as prescribed by CBSE FOR the year 2013-2014. Date : Signature of Internal Examiner Signature of External Examiner __________________ __________________ 4

HEADER FILES USED AND THEIR PURPOSE 1. CONIO.H - for clrscr(), getch() functions 2. STDIO.H - Standard I/O Operations 3. PROCESS.H - for exit() function 4. FSTREAM.H - for data file handling operations 5. STDLIB.H - for random() function 5

6

CODE OF THE PROGRAM 7

//*************************************************************** // HEADER FILE USED IN PROJECT //**************************************************************** #include<conio.h> #include<stdio.h> #include<process.h> #include<fstream.h> #include<stdlib.h> //*************************************************************** // CLASSES USED IN PROJECT //**************************************************************** class product { int pno; char name[30]; float price; public: void create_product() { cout<<"n Please Enter The Product No. of The Product : "; cin>>pno; cout<<"nn Please Enter The Name of The Product : "; gets(name); cout<<"n Please Enter The Price of The Product : "; cin>>price; } void show_product() { cout<<"n The Product No. of The Product : "<<pno; cout<<"n The Name of The Product : "; puts(name); cout<<"n The Price of The Product : "<<price; } int retpno() { return pno; } float retprice() { return price; } char* retname() { return name; } }; // End Of Class //*************************************************************** // global declaration for stream object, object //**************************************************************** fstream fp; product pr; //*************************************************************** // function to write in file //**************************************************************** void write_product() { fp.open("Shop.dat",ios::app); pr.create_product(); fp.write((char*)&pr,sizeof(product)); fp.close(); cout<<"nn The Product Has Been Created "; getch(); 8

} //*************************************************************** // function to read all records from file //**************************************************************** void display_all() { clrscr(); cout<<"nnntt DISPLAY ALL RECORD !!!nn"; fp.open("Shop.dat",ios::in); while(fp.read((char*)&pr,sizeof(product))) { pr.show_product(); cout<<"nn====================================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<<"nn record not exist"; getch(); } //*************************************************************** // function to modify record of file //**************************************************************** void modify_product() { int no, found=0; clrscr(); cout<<"nnt To Modify "; cout<<"nnt Please 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) 9

{ pr.show_product(); cout<<"n Please Enter The New Details of Product"<<endl; pr.create_product(); int pos=-1*sizeof(pr); fp.seekp(pos,ios::cur); fp.write((char*)&pr,sizeof(product)); cout<<"nnt Record Updated"; found=1; } } fp.close(); if(found==0) cout<<"nn Record Not Found "; getch(); } //*************************************************************** // function to delete record of file //**************************************************************** void delete_product() { int no; clrscr(); cout<<"nnnt Delete Record"; cout<<"nn Please 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<<"nnt Record Deleted .."; getch(); } //*************************************************************** // function to display all products price list //**************************************************************** void menu() { clrscr(); fp.open("Shop.dat",ios::in); if(!fp) { 10

cout<<"ERROR!!! FILE COULD NOT BE OPENnnn Go To Admin Menu to create File"; cout<<"nnn Program is closing ...."; getch(); exit(0); } cout<<"nntt Product MENUnn"; cout<<"====================================================n"; cout<<"P.NO.tt NAMEttt PRICEn"; cout<<"====================================================n"; while(fp.read((char*)&pr,sizeof(product))) { cout<<pr.retpno()<<"tt"<<pr.retname()<<"tt"<<pr.retprice()<<endl; } cout<<"====================================================n"; fp.close(); } //*************************************************************** // function to generate discount //**************************************************************** void disc_app(int total) { randomize(); int disc=0, tbpamt=total, rnum2=0; int SPNUM[9]= { 1,5,6,13,29,43,73,91,96}; if (total < 1000) cout<<” n n Amount to be paid after discount : - Rs. "<<tbpamt; if (total >=1000) { if ((total%2 ==1) && (total %5 ==0)) disc =random (90); tbpamt = total - ((disc*total)/100); cout<<" n n Amount to be paid after discount : - Rs. "<<tbpamt; } else { rnum2= random(SPNUM[9]); if ( (rnum2 == 1) ||(rnum2 == 6) || (rnum2 ==29) ) tbpamt = total - (0.25*total); else if ( (rnum2 == 5) ||(rnum2 == 13) || (rnum2 ==91) ) tbpamt = total - (0.5*total); else if ( (rnum2 == 43) ||(rnum2 == 73) || (rnum2 ==96) ) tbpamt = total - (0.3*total); cout<<"nn Amount to be paid after discount"<<tbpamt; } getch(); } //*************************************************************** // function to place order and generating bill for Products 11

//**************************************************************** void place_order() { int order_arr[50],quan[50],c=0, ic = 0; float amt,total=0; char ch='Y'; menu(); cout<<"nn"; cout<<"n PLACE YOUR ORDER"; cout<<"nnnn"; do{ cout<<"nn Enter The Product No. Of The Product : "; cin>>order_arr[c]; cout<<"Quantity in number : "; cin>>quan[c], ic +=quan[c]; c++; cout<<"Do You Want To Order Another Product ? (y/n)"; cin>>ch; }while(ch=='y' ||ch=='Y'); cout<<"nnThank You For Placing The Order"; getch(); clrscr(); cout<<"nnn"; cout<<"nn********************************INVOICE******************* *****n"; cout<<"Pr No.t Pr Namett Quantity t Price t Amountn"; cout<<"************************************************************** *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]; cout<<"n"<<order_arr[x]<<"t"<<pr.retname()<<"t"<<quan[x]<<"tt"<<pr.retprice( )<<"t"<<amt; total+=amt; } fp.read((char*)&pr,sizeof(product)); } fp.close(); } 12

cout<<"n"<<"********************************************************* ******"; cout<<"n Items count:-"<<ic<<"tttt"<<"Bill Amount:-"<<total; getch(); disc_app(total); } //*************************************************************** // INTRODUCTION FUNCTION //**************************************************************** void intro() { clrscr(); gotoxy(30,15); cout<<"n====================================================== ======="; cout<<"n"<<"|"<<" Welcome to purchase corner of Shopping Mall |"; cout<<"n"<<"|"<<" MADE BY : Pranav & Kausal |"; cout<<"n"<<"|"<<" SCHOOL : Kendriya Vidyalaya B.E.G. |"; cout<<"n"<<"================================================== ==========="; getch(); } //*************************************************************** // ADMINSTRATOR MENU FUNCTION //**************************************************************** void admin_menu() { clrscr(); char ch2; cout<<"###############################################"; cout<<"nnnt ADMINISTRATOR MENU"; cout<<"nnt1.CREATE PRODUCT"; cout<<"nnt2.DISPLAY ALL PRODUCTS"; cout<<"nnt3.QUERY "; cout<<"nnt4.MODIFY PRODUCT"; cout<<"nnt5.DELETE PRODUCT"; cout<<"nnt6.VIEW PRODUCT MENU"; cout<<"nnt7.BACK TO MAIN MENU"; cout<<"nnt Please Enter Your Choice (1-8) "; cout<<"n################################################"; ch2=getche(); cout<<"###############################################"; switch(ch2) { case '1': clrscr(); write_product(); break; case '2': display_all();break; 13

case '3': int num; clrscr(); cout<<"nnt Please 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<<"nnnt MAIN MENU"; cout<<"nnt01. CUSTOMER"; cout<<"nnt02. ADMINISTRATOR"; cout<<"nnt03. EXIT"; cout<<"nnt Please 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'); } 14

REQUIREMENTS  SOFTWARE REQUIRED  Operating system : Windows XP or later  Turbo C++, for execution of program and  MS Office, for presentation of output. DISCLAIMER :I HAVE ALSO MADE THIS PROJECT TAKING HELP FROM INTERNET I EXPREE MY REGARDS WHO ARE ACTUALLY BEHIND THIS PROJECT. I HAVE UPLOADED THIS ONLY SO THAT MORE PEOPLE CAN TAKE HELP FROM THIS UPLOAD THROUGH MY PROFILE IN SLIDESHARE… TO REGISTER YOUR OBJECTION TO THIS UPLOAD PLZ COMMENT UNDER THE PRESENTATION IN THE WEBSITE 15

BIBLIOGRAPHY COMPUTER SCIENCE IN C++ BY :– SUMITA ARORA (Class:- ‘XI’, ‘XII’) www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com 16

www.cbseportal.com www.cbseportal.com www.cbseportal.com www.cbseportal.com 17

Add a comment

Related presentations

Related pages

Einkaufszentrum – Wikipedia

Ein Einkaufszentrum, auch Shoppingmall (kurz Mall), Shoppingcenter beziehungsweise Shopping Centre, ist eine räumliche und organisatorische Konzentration ...
Read more

Shopping mall - Wikipedia, the free encyclopedia

A shopping mall is a modern, chiefly North American, term for a form of shopping precinct or shopping center, in which one or more buildings form a complex ...
Read more

dict.cc | shopping mall | Wörterbuch Englisch-Deutsch

Übersetzung für shopping mall im Englisch-Deutsch-Wörterbuch dict.cc.
Read more

FLORIDA Shopping Malls Shops Outlets - floridajournal.de

Shopping Centre / Shopping Mall, Region / Infos und Website ... Florida Mall, Orlando 8001 South Orange Blossom Trail Orlando, FL 32809 Florida Mall, Orlando
Read more

Malls & Designer Outlets - NewYork.de

Sie sind hier: newyork.de » Shopping » Malls & Outlets. Malls & Outlets. Für all diejenigen, die gerne shoppen, nicht aber lange suchen möchten, ...
Read more

Shopping mall - definition of shopping mall by The Free ...

shopping mall n. 1. An urban shopping area limited to pedestrians. 2. A shopping center with stores and businesses facing a system of enclosed walkways for ...
Read more

Dubai Shopping Malls

Ein Gigant mit über 1.200 Geschäften in Dubai ist die neue Dubai Mall. Sie ist die größte Shopping Mall in Dubai und momentan ...
Read more

Shopping Mall - Abenteuerspiele - 1001 Spiele

Shopping Mall. Spiel auch eines der anderen coolen Abenteuerspiele auf 1001Spiele.de!
Read more

Shopping - Wikipedia, the free encyclopedia

A woman shopping at a shopping mall in the United States in December 2005. The shopping experience can range from delightful to terrible, ...
Read more

Shopping Mall - kostenlos online spielen auf JetztSpielen.de

Hilf dem Mädchen, alle Gegenstände zu sammeln und den Feinden auszuweichen! - Versuch es gleich und spiel Shopping Mall kostenlos auf jetztspielen.de
Read more