SlideShare a Scribd company logo
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

More Related Content

What's hot

College admission system
College admission system College admission system
College admission system
Sourabh Upadhyay
 
Library management in Data structure
Library management in Data structure Library management in Data structure
Library management in Data structure
harshil1902
 
What are "virtual beacons"?
What are "virtual beacons"?What are "virtual beacons"?
What are "virtual beacons"?
Petr Dvorak
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
Swakriti Rathore
 
Library management system
Library management systemLibrary management system
Library management system
Arman Ahmed
 
Online Book Store Project Presentation by Moin Khan & Sejda E Jannat
Online Book Store Project Presentation by Moin Khan & Sejda E JannatOnline Book Store Project Presentation by Moin Khan & Sejda E Jannat
Online Book Store Project Presentation by Moin Khan & Sejda E Jannat
SejdaEJannat
 
Library management system presentation
Library management system presentation Library management system presentation
Library management system presentation
Smit Patel
 
PL/SQL
PL/SQLPL/SQL
PL/SQL
Vaibhav0
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
zahid6
 
Library Management Project Presentation
Library Management Project PresentationLibrary Management Project Presentation
Library Management Project Presentation
Sanket Kudalkar
 
Srs template 1
Srs template 1Srs template 1
Srs template 1
Tarveen Raza
 
Student information system project report
Student information system project reportStudent information system project report
Student information system project report
Suman Chandra
 
Hospital Management System Project
Hospital Management System ProjectHospital Management System Project
Hospital Management System Project
Sanjit Yadav
 
STUDENT REPORT CARD GENERATE SYSTEM
STUDENT REPORT CARD GENERATE SYSTEMSTUDENT REPORT CARD GENERATE SYSTEM
STUDENT REPORT CARD GENERATE SYSTEM
vikram mahendra
 
Vision and Scope Document For Library Management System
Vision and Scope Document For Library Management SystemVision and Scope Document For Library Management System
Vision and Scope Document For Library Management System
Soman Sarim
 
Project ppt.pptx
Project ppt.pptxProject ppt.pptx
Project ppt.pptx
SnehaDR2
 
Database management system
Database management systemDatabase management system
Database management systemStudsPlanet.com
 
SRS on airline reservation system
SRS on airline reservation system SRS on airline reservation system
SRS on airline reservation system
VikasSingh958
 

What's hot (20)

College admission system
College admission system College admission system
College admission system
 
Library management in Data structure
Library management in Data structure Library management in Data structure
Library management in Data structure
 
What are "virtual beacons"?
What are "virtual beacons"?What are "virtual beacons"?
What are "virtual beacons"?
 
c++ project on restaurant billing
c++ project on restaurant billing c++ project on restaurant billing
c++ project on restaurant billing
 
Library management system
Library management systemLibrary management system
Library management system
 
Online Book Store Project Presentation by Moin Khan & Sejda E Jannat
Online Book Store Project Presentation by Moin Khan & Sejda E JannatOnline Book Store Project Presentation by Moin Khan & Sejda E Jannat
Online Book Store Project Presentation by Moin Khan & Sejda E Jannat
 
Library management system presentation
Library management system presentation Library management system presentation
Library management system presentation
 
PL/SQL
PL/SQLPL/SQL
PL/SQL
 
Introduction to database & sql
Introduction to database & sqlIntroduction to database & sql
Introduction to database & sql
 
Library Management Project Presentation
Library Management Project PresentationLibrary Management Project Presentation
Library Management Project Presentation
 
Srs template 1
Srs template 1Srs template 1
Srs template 1
 
Student information system project report
Student information system project reportStudent information system project report
Student information system project report
 
MYSQL.ppt
MYSQL.pptMYSQL.ppt
MYSQL.ppt
 
Hospital Management System Project
Hospital Management System ProjectHospital Management System Project
Hospital Management System Project
 
Sql injection
Sql injectionSql injection
Sql injection
 
STUDENT REPORT CARD GENERATE SYSTEM
STUDENT REPORT CARD GENERATE SYSTEMSTUDENT REPORT CARD GENERATE SYSTEM
STUDENT REPORT CARD GENERATE SYSTEM
 
Vision and Scope Document For Library Management System
Vision and Scope Document For Library Management SystemVision and Scope Document For Library Management System
Vision and Scope Document For Library Management System
 
Project ppt.pptx
Project ppt.pptxProject ppt.pptx
Project ppt.pptx
 
Database management system
Database management systemDatabase management system
Database management system
 
SRS on airline reservation system
SRS on airline reservation system SRS on airline reservation system
SRS on airline reservation system
 

Similar to Shopping mall

Sunil
SunilSunil
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCEPLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
Pradeep Kv
 
Computer
ComputerComputer
Computer
Gaurav Kumar
 
Durgesh
DurgeshDurgesh
Durgesh
dkbossverma
 
hitter !!!!!!!!!!!!!!!!!!!!!!!!
hitter !!!!!!!!!!!!!!!!!!!!!!!!hitter !!!!!!!!!!!!!!!!!!!!!!!!
hitter !!!!!!!!!!!!!!!!!!!!!!!!
hiteshborha
 
~ Project-student report-card.cpp[1]
~ Project-student report-card.cpp[1]~ Project-student report-card.cpp[1]
~ Project-student report-card.cpp[1]Sunny Rekhi
 
C# Assignmet Help
C# Assignmet HelpC# Assignmet Help
C# Assignmet Help
Programming Homework Help
 
Implementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in CImplementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in C
Kasun Ranga Wijeweera
 
Tool sdl2pml
Tool sdl2pmlTool sdl2pml
Tool sdl2pml
S56WBV
 
Quiz using C++
Quiz using C++Quiz using C++
Quiz using C++
Sushil Mishra
 
GPA calculator and grading program in c++
GPA calculator and grading program in c++GPA calculator and grading program in c++
GPA calculator and grading program in c++
Taimur Muhammad
 
Lab Assignment 4 CSE330 Spring 2014 Skeleton Code for ex.docx
 Lab Assignment 4 CSE330 Spring 2014  Skeleton Code for ex.docx Lab Assignment 4 CSE330 Spring 2014  Skeleton Code for ex.docx
Lab Assignment 4 CSE330 Spring 2014 Skeleton Code for ex.docx
MARRY7
 
Instruction1. Please read the two articles. (Kincheloe part 1 &.docx
Instruction1. Please read the two articles. (Kincheloe part 1 &.docxInstruction1. Please read the two articles. (Kincheloe part 1 &.docx
Instruction1. Please read the two articles. (Kincheloe part 1 &.docx
carliotwaycave
 
2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools plannerGeoffrey De Smet
 
C++ Programm.pptx
C++ Programm.pptxC++ Programm.pptx
C++ Programm.pptx
Åįjâž Ali
 
Pro.docx
Pro.docxPro.docx
DeVry GSP 115 Week 3 Assignment latest
DeVry GSP 115 Week 3 Assignment latestDeVry GSP 115 Week 3 Assignment latest
DeVry GSP 115 Week 3 Assignment latest
Atifkhilji
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++
vikram mahendra
 
Pandora FMS: PostgreSQL Plugin
Pandora FMS: PostgreSQL PluginPandora FMS: PostgreSQL Plugin
Pandora FMS: PostgreSQL Plugin
Pandora FMS
 

Similar to Shopping mall (20)

Sunil
SunilSunil
Sunil
 
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCEPLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
 
Computer
ComputerComputer
Computer
 
Supermarket
SupermarketSupermarket
Supermarket
 
Durgesh
DurgeshDurgesh
Durgesh
 
hitter !!!!!!!!!!!!!!!!!!!!!!!!
hitter !!!!!!!!!!!!!!!!!!!!!!!!hitter !!!!!!!!!!!!!!!!!!!!!!!!
hitter !!!!!!!!!!!!!!!!!!!!!!!!
 
~ Project-student report-card.cpp[1]
~ Project-student report-card.cpp[1]~ Project-student report-card.cpp[1]
~ Project-student report-card.cpp[1]
 
C# Assignmet Help
C# Assignmet HelpC# Assignmet Help
C# Assignmet Help
 
Implementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in CImplementation of k-means clustering algorithm in C
Implementation of k-means clustering algorithm in C
 
Tool sdl2pml
Tool sdl2pmlTool sdl2pml
Tool sdl2pml
 
Quiz using C++
Quiz using C++Quiz using C++
Quiz using C++
 
GPA calculator and grading program in c++
GPA calculator and grading program in c++GPA calculator and grading program in c++
GPA calculator and grading program in c++
 
Lab Assignment 4 CSE330 Spring 2014 Skeleton Code for ex.docx
 Lab Assignment 4 CSE330 Spring 2014  Skeleton Code for ex.docx Lab Assignment 4 CSE330 Spring 2014  Skeleton Code for ex.docx
Lab Assignment 4 CSE330 Spring 2014 Skeleton Code for ex.docx
 
Instruction1. Please read the two articles. (Kincheloe part 1 &.docx
Instruction1. Please read the two articles. (Kincheloe part 1 &.docxInstruction1. Please read the two articles. (Kincheloe part 1 &.docx
Instruction1. Please read the two articles. (Kincheloe part 1 &.docx
 
2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner2012 02-04 fosdem 2012 - drools planner
2012 02-04 fosdem 2012 - drools planner
 
C++ Programm.pptx
C++ Programm.pptxC++ Programm.pptx
C++ Programm.pptx
 
Pro.docx
Pro.docxPro.docx
Pro.docx
 
DeVry GSP 115 Week 3 Assignment latest
DeVry GSP 115 Week 3 Assignment latestDeVry GSP 115 Week 3 Assignment latest
DeVry GSP 115 Week 3 Assignment latest
 
SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++SUPER MARKET COMPUTER SYSTEM IN C++
SUPER MARKET COMPUTER SYSTEM IN C++
 
Pandora FMS: PostgreSQL Plugin
Pandora FMS: PostgreSQL PluginPandora FMS: PostgreSQL Plugin
Pandora FMS: PostgreSQL Plugin
 

More from Pranav Ghildiyal

Lasers
LasersLasers
Global warming :- A PowerPoint Presentation
Global warming :- A PowerPoint PresentationGlobal warming :- A PowerPoint Presentation
Global warming :- A PowerPoint Presentation
Pranav Ghildiyal
 
A Report On Disaster Management
A Report On Disaster ManagementA Report On Disaster Management
A Report On Disaster Management
Pranav Ghildiyal
 
Recycle and reuse of everyday material
Recycle and reuse of everyday materialRecycle and reuse of everyday material
Recycle and reuse of everyday material
Pranav Ghildiyal
 
Word of the day (may)
Word of  the day (may)Word of  the day (may)
Word of the day (may)
Pranav Ghildiyal
 
Boost your knowledge
Boost your knowledgeBoost your knowledge
Boost your knowledge
Pranav Ghildiyal
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
Pranav Ghildiyal
 
CBSE Class XII physics practical project on Metal detector
CBSE Class XII physics practical project on Metal detectorCBSE Class XII physics practical project on Metal detector
CBSE Class XII physics practical project on Metal detector
Pranav Ghildiyal
 
CBSE Class XII practical project on Rayon threads
CBSE Class XII practical project on Rayon threadsCBSE Class XII practical project on Rayon threads
CBSE Class XII practical project on Rayon threadsPranav Ghildiyal
 
CBSE Class X Rise of nationalism in europe
CBSE Class X Rise of nationalism in europeCBSE Class X Rise of nationalism in europe
CBSE Class X Rise of nationalism in europe
Pranav Ghildiyal
 
H1 n1 swine flu
H1 n1 swine fluH1 n1 swine flu
H1 n1 swine flu
Pranav Ghildiyal
 
CBSE Class IX Social Studies ECONOMICS Poverty as a challenge
CBSE Class IX Social Studies ECONOMICS Poverty as a challengeCBSE Class IX Social Studies ECONOMICS Poverty as a challenge
CBSE Class IX Social Studies ECONOMICS Poverty as a challenge
Pranav Ghildiyal
 
CBSE Class IX Sciense Physics Sound
CBSE Class IX Sciense Physics SoundCBSE Class IX Sciense Physics Sound
CBSE Class IX Sciense Physics Sound
Pranav Ghildiyal
 
CBSE Class IX Chemistry Natural resources
CBSE Class IX Chemistry Natural resourcesCBSE Class IX Chemistry Natural resources
CBSE Class IX Chemistry Natural resources
Pranav Ghildiyal
 
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pureCBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
Pranav Ghildiyal
 
CBSE Class X Chemical reactions and equations
CBSE Class X Chemical reactions and equationsCBSE Class X Chemical reactions and equations
CBSE Class X Chemical reactions and equations
Pranav Ghildiyal
 
CBSE Class XI Chemistry :- Organic chemistry (Basics)
CBSE Class XI Chemistry :- Organic chemistry (Basics)CBSE Class XI Chemistry :- Organic chemistry (Basics)
CBSE Class XI Chemistry :- Organic chemistry (Basics)
Pranav Ghildiyal
 
CBSE Class XI Maths Arthmetic progression
CBSE Class XI Maths Arthmetic progressionCBSE Class XI Maths Arthmetic progression
CBSE Class XI Maths Arthmetic progression
Pranav Ghildiyal
 
CBSE Class XI Maths Linear inequalities
CBSE Class XI Maths Linear inequalitiesCBSE Class XI Maths Linear inequalities
CBSE Class XI Maths Linear inequalities
Pranav Ghildiyal
 
CBSE Class X English Lack of sleep
CBSE Class X English Lack of sleepCBSE Class X English Lack of sleep
CBSE Class X English Lack of sleep
Pranav Ghildiyal
 

More from Pranav Ghildiyal (20)

Lasers
LasersLasers
Lasers
 
Global warming :- A PowerPoint Presentation
Global warming :- A PowerPoint PresentationGlobal warming :- A PowerPoint Presentation
Global warming :- A PowerPoint Presentation
 
A Report On Disaster Management
A Report On Disaster ManagementA Report On Disaster Management
A Report On Disaster Management
 
Recycle and reuse of everyday material
Recycle and reuse of everyday materialRecycle and reuse of everyday material
Recycle and reuse of everyday material
 
Word of the day (may)
Word of  the day (may)Word of  the day (may)
Word of the day (may)
 
Boost your knowledge
Boost your knowledgeBoost your knowledge
Boost your knowledge
 
CBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical fileCBSE Class XII Comp sc practical file
CBSE Class XII Comp sc practical file
 
CBSE Class XII physics practical project on Metal detector
CBSE Class XII physics practical project on Metal detectorCBSE Class XII physics practical project on Metal detector
CBSE Class XII physics practical project on Metal detector
 
CBSE Class XII practical project on Rayon threads
CBSE Class XII practical project on Rayon threadsCBSE Class XII practical project on Rayon threads
CBSE Class XII practical project on Rayon threads
 
CBSE Class X Rise of nationalism in europe
CBSE Class X Rise of nationalism in europeCBSE Class X Rise of nationalism in europe
CBSE Class X Rise of nationalism in europe
 
H1 n1 swine flu
H1 n1 swine fluH1 n1 swine flu
H1 n1 swine flu
 
CBSE Class IX Social Studies ECONOMICS Poverty as a challenge
CBSE Class IX Social Studies ECONOMICS Poverty as a challengeCBSE Class IX Social Studies ECONOMICS Poverty as a challenge
CBSE Class IX Social Studies ECONOMICS Poverty as a challenge
 
CBSE Class IX Sciense Physics Sound
CBSE Class IX Sciense Physics SoundCBSE Class IX Sciense Physics Sound
CBSE Class IX Sciense Physics Sound
 
CBSE Class IX Chemistry Natural resources
CBSE Class IX Chemistry Natural resourcesCBSE Class IX Chemistry Natural resources
CBSE Class IX Chemistry Natural resources
 
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pureCBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
CBSE Class IX SCIENCE CHEMISTRY Is matter around us pure
 
CBSE Class X Chemical reactions and equations
CBSE Class X Chemical reactions and equationsCBSE Class X Chemical reactions and equations
CBSE Class X Chemical reactions and equations
 
CBSE Class XI Chemistry :- Organic chemistry (Basics)
CBSE Class XI Chemistry :- Organic chemistry (Basics)CBSE Class XI Chemistry :- Organic chemistry (Basics)
CBSE Class XI Chemistry :- Organic chemistry (Basics)
 
CBSE Class XI Maths Arthmetic progression
CBSE Class XI Maths Arthmetic progressionCBSE Class XI Maths Arthmetic progression
CBSE Class XI Maths Arthmetic progression
 
CBSE Class XI Maths Linear inequalities
CBSE Class XI Maths Linear inequalitiesCBSE Class XI Maths Linear inequalities
CBSE Class XI Maths Linear inequalities
 
CBSE Class X English Lack of sleep
CBSE Class X English Lack of sleepCBSE Class X English Lack of sleep
CBSE Class X English Lack of sleep
 

Shopping mall

  • 1. PROJECT PREPARED BY: PRANAV GHILDIYAL XII B Session: 2013-2014 KENDRIYA VIDYALAYA B.E.G 1
  • 2. 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
  • 3. 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
  • 4. 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
  • 5. 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. 6
  • 8. //*************************************************************** // 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
  • 9. } //*************************************************************** // 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
  • 10. { 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
  • 11. 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
  • 12. //**************************************************************** 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
  • 13. 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
  • 14. 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
  • 15. 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
  • 16. 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