SlideShare uma empresa Scribd logo
1 de 17
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

Mais conteúdo relacionado

Mais procurados

Assignment 2 (16-08-2013)
Assignment 2 (16-08-2013)Assignment 2 (16-08-2013)
Assignment 2 (16-08-2013)Sanjay Pathak
 
CS Project-Source code for shopping inventory for CBSE 12th
CS Project-Source code for shopping inventory for CBSE 12thCS Project-Source code for shopping inventory for CBSE 12th
CS Project-Source code for shopping inventory for CBSE 12thSudhindra Mudhol
 
Food Order in a Restaurant - Data Structure Project
Food Order in a Restaurant - Data Structure ProjectFood Order in a Restaurant - Data Structure Project
Food Order in a Restaurant - Data Structure ProjectMd. Musfiqur Rahman Foysal
 
Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...deboshreechatterjee2
 
Online Fitness Gym Project Presentation
Online Fitness Gym Project Presentation Online Fitness Gym Project Presentation
Online Fitness Gym Project Presentation Abhishek Patel
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Pythonvikram mahendra
 
COMPUTER SCIENCE INVESTIGATORY PROJECT ON FOOTBALL GAME AND SCORE MANAGEMENT ...
COMPUTER SCIENCE INVESTIGATORY PROJECT ON FOOTBALL GAME AND SCORE MANAGEMENT ...COMPUTER SCIENCE INVESTIGATORY PROJECT ON FOOTBALL GAME AND SCORE MANAGEMENT ...
COMPUTER SCIENCE INVESTIGATORY PROJECT ON FOOTBALL GAME AND SCORE MANAGEMENT ...pankajkumbara
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12RithuJ
 
Java Programs Lab File
Java Programs Lab FileJava Programs Lab File
Java Programs Lab FileKandarp Tiwari
 
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...Fatima Qayyum
 
computer science with python project for class 12 cbse
computer science with python project for class 12 cbsecomputer science with python project for class 12 cbse
computer science with python project for class 12 cbsemanishjain598
 
A project report on libray mgt system
A project report on libray mgt system A project report on libray mgt system
A project report on libray mgt system ashvan710883
 
Web based online shopping system Presentation slide
Web based online shopping system Presentation  slideWeb based online shopping system Presentation  slide
Web based online shopping system Presentation slideRakibul Hasan Pranto
 
class 12th computer science project Employee Management System In Python
 class 12th computer science project Employee Management System In Python class 12th computer science project Employee Management System In Python
class 12th computer science project Employee Management System In PythonAbhishekKumarMorla
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functionssinhacp
 
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)KAUSHAL KUMAR JHA
 

Mais procurados (20)

Assignment 2 (16-08-2013)
Assignment 2 (16-08-2013)Assignment 2 (16-08-2013)
Assignment 2 (16-08-2013)
 
Project report
Project reportProject report
Project report
 
CS Project-Source code for shopping inventory for CBSE 12th
CS Project-Source code for shopping inventory for CBSE 12thCS Project-Source code for shopping inventory for CBSE 12th
CS Project-Source code for shopping inventory for CBSE 12th
 
Food Order in a Restaurant - Data Structure Project
Food Order in a Restaurant - Data Structure ProjectFood Order in a Restaurant - Data Structure Project
Food Order in a Restaurant - Data Structure Project
 
Students report card for C++ project..
Students report card for C++ project..Students report card for C++ project..
Students report card for C++ project..
 
Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...Social Media Site User Management System Class 12th Informatics Practices Pyt...
Social Media Site User Management System Class 12th Informatics Practices Pyt...
 
Online Fitness Gym Project Presentation
Online Fitness Gym Project Presentation Online Fitness Gym Project Presentation
Online Fitness Gym Project Presentation
 
BOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in PythonBOOK SHOP SYSTEM Project in Python
BOOK SHOP SYSTEM Project in Python
 
COMPUTER SCIENCE INVESTIGATORY PROJECT ON FOOTBALL GAME AND SCORE MANAGEMENT ...
COMPUTER SCIENCE INVESTIGATORY PROJECT ON FOOTBALL GAME AND SCORE MANAGEMENT ...COMPUTER SCIENCE INVESTIGATORY PROJECT ON FOOTBALL GAME AND SCORE MANAGEMENT ...
COMPUTER SCIENCE INVESTIGATORY PROJECT ON FOOTBALL GAME AND SCORE MANAGEMENT ...
 
Library Management Project (computer science) class 12
Library Management Project (computer science) class 12Library Management Project (computer science) class 12
Library Management Project (computer science) class 12
 
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM)
 
Java Programs Lab File
Java Programs Lab FileJava Programs Lab File
Java Programs Lab File
 
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...
A Low-Cost IoT Application for the Urban Traffic of Vehicles, Based on Wirele...
 
computer science with python project for class 12 cbse
computer science with python project for class 12 cbsecomputer science with python project for class 12 cbse
computer science with python project for class 12 cbse
 
A project report on libray mgt system
A project report on libray mgt system A project report on libray mgt system
A project report on libray mgt system
 
Web based online shopping system Presentation slide
Web based online shopping system Presentation  slideWeb based online shopping system Presentation  slide
Web based online shopping system Presentation slide
 
class 12th computer science project Employee Management System In Python
 class 12th computer science project Employee Management System In Python class 12th computer science project Employee Management System In Python
class 12th computer science project Employee Management System In Python
 
Aggregate functions
Aggregate functionsAggregate functions
Aggregate functions
 
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
Software Requirements Specification on Pubg Gaming App (SRS on PUBG)
 
Project report on blogs
Project report on blogsProject report on blogs
Project report on blogs
 

Semelhante a Shopping mall

PLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCEPLAYER PROFILE MANAGEMENT COMPUTER SCIENCE
PLAYER PROFILE MANAGEMENT COMPUTER SCIENCEPradeep Kv
 
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
 
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 CKasun Ranga Wijeweera
 
Tool sdl2pml
Tool sdl2pmlTool sdl2pml
Tool sdl2pmlS56WBV
 
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.docxMARRY7
 
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 &.docxcarliotwaycave
 
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
 
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 latestAtifkhilji
 
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 PluginPandora FMS
 

Semelhante a 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
 

Mais de Pranav Ghildiyal

Global warming :- A PowerPoint Presentation
Global warming :- A PowerPoint PresentationGlobal warming :- A PowerPoint Presentation
Global warming :- A PowerPoint PresentationPranav Ghildiyal
 
A Report On Disaster Management
A Report On Disaster ManagementA Report On Disaster Management
A Report On Disaster ManagementPranav Ghildiyal
 
Recycle and reuse of everyday material
Recycle and reuse of everyday materialRecycle and reuse of everyday material
Recycle and reuse of everyday materialPranav 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 filePranav 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 detectorPranav 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 europePranav 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 challengePranav Ghildiyal
 
CBSE Class IX Sciense Physics Sound
CBSE Class IX Sciense Physics SoundCBSE Class IX Sciense Physics Sound
CBSE Class IX Sciense Physics SoundPranav Ghildiyal
 
CBSE Class IX Chemistry Natural resources
CBSE Class IX Chemistry Natural resourcesCBSE Class IX Chemistry Natural resources
CBSE Class IX Chemistry Natural resourcesPranav 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 purePranav 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 equationsPranav 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 progressionPranav Ghildiyal
 
CBSE Class XI Maths Linear inequalities
CBSE Class XI Maths Linear inequalitiesCBSE Class XI Maths Linear inequalities
CBSE Class XI Maths Linear inequalitiesPranav 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 sleepPranav Ghildiyal
 

Mais de 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