Anda di halaman 1dari 39

Submitted by - Under the guidance of -

Palash Chaturvedi Mr. Manoj Lukose


Class – XII A
Roll No - 1673783
CERTIFICATE

This is to certify that the project developed by Palash Chaturvedi of


class XII – A entitled Shop Management, is bonafide work of the
student in the Computer Science Lab during the academic year 2013-
14 is carried out with the consultation of Teacher Incharge.

__________________ ___________________

Examiner’s Signature Mr. Manoj Lukose

(Teacher Incharge)
ACKNOLEDGEMENT

It is with great pleasure that I find myself penning down these lines
to express my sincere thanks to various people who helped me a long
way in completing this project.

The harmonious climate in our school provided proper guide for


preparing the project. It was a privilege to have been guided by our
computer teacher.

Thanks to all my classmates who helped me during development of


this project with their constructive criticism and advice.
CONTENTS

1. Overview

2. Introduction to C++

3. Header files used

4. Hardware and Software requirements

5. Flowchart

6. Source codes

7. Outputs

8. Bibliography
OVERVIEW

This is a Shop Management software which can be used by Store


Keepers to manage product details available in their store and for
Billing Purpose. In this application, we allow store keepers to enter
the details of the products available in their store, to view them, to
delete them, and prepare bills.

Features provided by this project are as follows:

1. Storing details of products: All the details of the products like


product no., product name, price can be stored in the
database.

2. Display product details: Store keepers can view all the details
of the product available in their store at any time.

3. Delete: This feature is also supported by this project. The list of


the products can be deleted any time and can be re created as
per their needs.

4. Billing : With the help of this feature user can get the whole list
of the products on the billing menu, so the user just need to
enter the product no. and all the details of that product will
automatically be displayed on the bill, with the total amount
that the customer needs to pay.
INTRODUCTION TO C++

The C++ programming language was developed at AT&T bell


laboratories in the early 1980’s by Bjarne Stroustrup. He found ‘C’
lacking for stimulations and decided to extend the language by
adding features from Simula 67 which was one of the earliest object
oriented languages. The name C++ was coined by Rick Mascitti
where ‘++’ is the ‘C’ increment operator. Ever since its birth, C++
involved coping with problems encountered by users and through
discussions at AT&T. However, the maturation of the language is
attested to by two events:
1. Formation of ANSI C++ committee.
2. Publication of “The Annotated C++ Reference Manual“ by
Ellis & Stroustrup.

C++ is one of the most popular programming languages and is


implemented on a wide variety of hardware and operating system
platforms. As an efficient compiler to native code, its application
domains include systems software, application software, device
drivers, embedded software, high-performance server and client
applications, and entertainment software such as video games.
FEATURES OF C++ PROGRAMS

In C++, you can develop new data types that contain functional
descriptions (member functions) as well as data representations.
These new data types are called classes. The work of developing
such classes is known as data abstraction. You can work with a
combination of classes from established class libraries, develop your
own classes, or derive new classes from existing classes by adding
data descriptions and functions. New classes can contain (inherit)
properties from one or more classes. The classes describe the data
types and functions available, but they can hide (encapsulate) the
implementation details from the client programs.

You can define a series of functions with different argument types


that all use the same function name. This is called function
overloading. A function can have the same name and argument types
in base and derived classes.

Declaring a class member function in a base class allows you to


override its implementation in a derived class. If you use virtual
functions, class-dependent behavior may be determined at run time.
This ability to select functions at run time, depending on data types,
is called polymorphism.

Every C++ program must have a function named main (). Program
execution begins at main () and continues by sequentially executing
the statements within main (). A program terminates normally
following execution of the last statement of main (). Curly braces
({&}) is used to express grouping of statements in C++. Every
executable statement in C++ must be terminated by a semicolon (;).
OOP CONCEPTS IN C++

The Object Oriented Programming has been developed with a view


to overcome the drawbacks of the conventional programming
approaches. The OOP approach is based on certain oncepts that help
it attain its goal of overcoming the drawbacks or shortcomings of
conventional programming approaches. These general concepts of
OOP are given below:

DATA ABSTRACTION

In C++, you can develop new data types that contain functional
descriptions (member functions) as well as data representations.
These new data types are called classes. The work of developing
such classes is known as data abstraction. You can work with a
combination of classes from established class libraries, develop your
own classes, or derive new classes from existing classes by adding
data descriptions and functions. New classes can contain (inherit)
properties from one or more classes. The classes describe the data
types and functions available, but they can hide (encapsulate) the
implementation details from the client programs.
INHERITANCE

It is the capability of one class of things to inherit capability or


properties from another class. Inheritance allows one data type to
acquire properties of other data types. Inheritance from a base
class may be declared as public, protected, or private. This access
specifier determines whether unrelated and derived classes can
access the inherited public and protected members of the base class.
Only public inheritance corresponds to what is usually meant by
"inheritance". The other two forms are much less frequently used. If
the access specifier is omitted, a "class" inherits privately, while a
"struct" inherits publicly.

POLYMORPHISM

It is the ability for a message to be processed in more than one form.


Declaring a class member function in a base class allows you to
override its implementation in a derived class. If you use virtual
functions, class-dependent behavior may be determined at run time.
This ability to select functions at run time, depending on data types,
is called polymorphism
SOME IMPORTANT DATA TYPES IN C++

ARRAYS
Arrays refer to a named list of a finite number n of similar data
elements. They maybe 1-dimensional, 2-dimensional or multi-
dimensional.
Example : float A[30];

FUNCTION
It is a named part of program, which can be invoked from other parts
of the program as often needed.

POINTER
It is a variable which holds a memory address. This address is
usually the location of another variable in memory.
Example : char *ptr;

CLASS
It represents a group of similar objects. A class describes all the
properties of a data type and an object is an entity created according
to that description.
HEADER FILES USED

 iostream.h

 fstream.h

 process.h

 conio.h

 stdio.h

 string.h

 dos.h

 graphics.h
SOFTWARE AND HARDWARE
REQUIREMENTS

SOFTWARE REQUIREMENTS:

Platform:windows 98/xp/2000.

Front end: turbo c++ version-3.0.

Back end: DOS file support.

HARDWARE REQUIREMENTS:

PIII 500 MH2 or higher.

RAM 64 MB or more.

HOD capacity 2GB or more.


FLOWCHART
START

CHOICE

Make a
1 purchase

Admin menu
2

Create a
Product

Display list

Delete

3 Exit
SOURCE CODE
#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<process.h>
#include<fstream.h>
#include<string.h>
#include<dos.h>
#include<graphics.h>

int p_no,choice1;
int logo();
int intro();
void last();

class product
{
int prod_no,qty;
char prod_name[30];
float prod_mrp,price;
public:
void display_product();
char* retprodname();
int retprodno();
float retprodprice();

void create_product()
{ cout<<"\n Enter product no.: ";
cin>>prod_no;
cout<<"\nEnter product name :";
gets(prod_name);
cout<<"\nEnter rate of product :";
cin>>prod_mrp;
}
};

void product::display_product()
{
cout<<"\nTHe Product no is :"<<prod_no;
cout<<"\nThe name of product is :";
puts(prod_name);
cout<<"\nThe price of product is :"<<prod_mrp;
}

int product::retprodno()
{return prod_no;}

char* product::retprodname()
{return prod_name;}

float product::retprodprice()
{return prod_mrp;}

void write_product()
{
fstream fp1;
product p;
fp1.open("shop.dat",ios::app|ios::binary);
p.create_product();
fp1.write((char*)&p,sizeof(product));
fp1.close();
cout<<"\n\nThe Product has been created";
delay(1000);
}

void displayall()
{
fstream fp;
product p;
clrscr();
cout<<"\n\n\n\t\tDISPLAY ALL RECORDS!!!\n\n";
fp.open("shop.dat",ios::in|ios::binary);
while(fp.read((char*)&p,sizeof(product)))
{
p.display_product();
cout<<"\n\n \n\n";
getch();
}
fp.close();
//delay(2500);
}
void delete_product()
{
fstream fp;
product p;
char y;
clrscr();
cout<<"\nAre you Sure You Want to Delete the records?? (Y or
N)\a\a\a\n";
cin>>y;
if(y=='y'||y=='Y')
{
cout<<"\n\n\tRecord Deleted ..";
delay(1000);
fp.open("Shop.dat",ios::in|ios::out|ios::binary);
fstream fp2;
fp2.open("Temp.dat",ios::out|ios::binary);

remove("Shop.dat");
rename("Temp.dat","Shop.dat");
}
}
void menu()
{
fstream fp;
product p;
clrscr();
fp.open("Shop.dat",ios::in|ios::binary);
if(!fp)
{
cout<<"ERROR!!! FILE COULD NOT BE OPEN\n\n\n Go To
Admin Menu to create a file";
getch();
exit(0);
}
cout<<"\n\n\t\t\t\tProduct MENU\n\n";

cout<<"\t################################################
#############\n";
cout<<"\t\t P.NO.\t\tNAME\t\tPRICE\n";

cout<<"\t################################################
#############\n";

while(fp.read((char*)&p,sizeof(product)))
{
cout<<"\t\t
"<<p.retprodno()<<"\t\t"<<p.retprodname()<<"\t\t"<<p.retprodprice(
)<<endl;
}
fp.close();
}

void placeorder()
{
fstream fp;
product p;
int order_arr[30],l=0,quan[30];
float total=0;
char ch='Y';
menu();
cout<<"\n\n\t\t\t============================";
cout<<"\n\t\t\t PLACE YOUR ORDER";
cout<<"\n\t\t\t============================\n";
do{
cout<<"\n\nEnter The Product Number Of The Product : ";
cin>>order_arr[l];
cout<<"\nQuantity in number : ";
cin>>quan[l];
l++;
cout<<"\nDo You Want To Order Another Product ? (y/n)";
cin>>ch;
}while(ch=='y' ||ch=='Y');
cout<<"\n\nThank You For Placing The Order";
clrscr();

cout<<"\n\n*************************************INVOICE
************************************\n";
cout<<"\nPr No.\t\tPr Name\t\t Quantity \t\tPrice \t\tAmount ";
for(int x=0;x<=l;x++)
{
fp.open("Shop.dat",ios::in|ios::binary);
fp.read((char*)&p,sizeof(product));
while(!fp.eof())
{
if(p.retprodno()==order_arr[x])
{
total+=p.retprodprice()*quan[x];

cout<<"\n"<<order_arr[x]<<"\t\t"<<p.retprodname()<<"\t\t\t"<<quan
[x]<<"\t\t"<<p.retprodprice()<<"\t\t"<<p.retprodprice()*quan[x];
getch();
}
fp.read((char*)&p,sizeof(product));
}

fp.close();
}
cout<<"\n\n\t\t\t\t\tTOTAL = "<<total;
cout<<"\n\n";
}

void adminmenu()
{
clrscr();
int ch;
cout<<"\n\n\n\tAdmin Menu";
cout<<"\n\n\t1.Create a Product";
cout<<"\n\n\t2.Display all Products";
cout<<"\n\n\t3.Delete All Product";
cout<<"\n\n\t4.Back to Main Menu";
cout<<"\n\n\tEnter your Choice (1-4) :";
cin>>ch;
switch(ch)
{
case 1: clrscr();
write_product();
break;
case 2: displayall();
break;
case 3: delete_product();
break;
case 4: break;
default: cout<<"\a";
adminmenu();
}
}

void login()
{
char m,k;
char username[20], password[20];
back:
clrscr();
cout<<"\n\n\n\t\t\t Login to Access the Store";
cout<<"\n\n\t\t\t Enter the detaiils below:";
cout<<"\n\n\n\t\tUSERNAME : ";
gets(username);
cout<<"\n\n\t\tPASSWORD : ";
gets(password);
if((strcmp(username,"username")!=0)||
(strcmp(password,"password")!=0))
{cout<<"\n\n\tWRONG PASSWORD!!!! Want to try Again>
(Y,y/N,n)";
cin>>m;
if (m=='y' || m=='Y')
goto back;
else
exit(0);
}
}

int logo()
{
restart:
clrscr();
void last();
int g=DETECT,d;
initgraph(&g, &d, "c:\\tc\\bgi");
int poly1[15];

//screen
poly1[0]=250;
poly1[1]=50;
poly1[2]=340;
poly1[3]=50;
poly1[4]=340;
poly1[5]=150;
poly1[6]=340;
poly1[7]=150;
poly1[8]=250;
poly1[9]=150;
drawpoly(5,poly1);
int poly2[15];
poly2[0]=260;
poly2[1]=60;
poly2[2]=330;
poly2[3]=60;
poly2[4]=330;
poly2[5]=140;
poly2[6]=260;
poly2[7]=140;
poly2[8]=260;
poly2[9]=60;
fillpoly(5,poly2);

//keyboard
int poly3[15];

poly3[0]=230;
poly3[1]=170;
poly3[2]=360;
poly3[3]=170;
poly3[4]=380;
poly3[5]=190;
poly3[6]=210;
poly3[7]=190;
poly3[8]=230;
poly3[9]=170;
setfillstyle(2,-1);
fillpoly(5,poly3);

line(250,50,250,150);
line(310,150,310,170);
line(280,150,280,170);

//mouse wire
arc(380, 190, 10, 120, 15);
arc(405,186, 190,270,10);
arc(407,200,10,100,4);

//mouse
ellipse(410, 204, 90, 450,6, 10);
//mouse button
arc(410,197,200,340,5);
int midx=getmaxx()/2;
int midy=getmaxy()/2;
settextstyle(TRIPLEX_FONT,HORIZ_DIR,2);
outtextxy(midx-243,midy+40,"WELCOME TO BIG
BAZAR ...A COMPLETE STORE !!!! ");
settextstyle(DEFAULT_FONT,HORIZ_DIR,1);
outtextxy(midx-130,midy+100,"For all your Daily needs !!! ");
outtextxy(midx-147,midy+140,"Press any key to enter the
Store.... ");
getch();
closegraph();
return(0);
}
void last()
{
cout<<"\n\n\n ,@@, \n\t\t"
<<" / / \n\t\t"
<<" Thanks For Shopping!! / / \n\t\t"
<<" \\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/._/ \n\t\t"
<<" \\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/ \n\t\t"
<<" \\~~~~~~~~~~~~~~~~~~~~~~~~~~~~~/ \n\t\t"
<<" \\~~~~~~~~~~~~~~~~~~~~~~~~~~~/ \n\t\t"
<<" \\~~~~~~~~~~~~~~~~~~~~~~~~~/ \n\t\t"
<<" \\_______________________/ \n\t\t"
<<" | | \n\t\t"
<<" |~~~~~~~~~~~~~~~~~~~~~~| \n\t\t"
<<" |______________________| \n\t\t"
<<" /``\\ /``\\ \n\t\t"
<<" \\__/ \\__/ \n\t\t";
delay(2000);
exit(0);
}

int intro()
{
clrscr();
textmode(BW80);
textcolor(2);
cprintf("\n\n Introduction");
textcolor(3);
cprintf("\n\n The following Project
is on the topic");
textcolor(5);
cprintf("\n\n SHOP
MANAGEMENT");
cprintf("\n\n\n\n");
textcolor(9);
cprintf(" The Project has been made By-");
textcolor(15);
cprintf("\n\n@ Divyanshu Khare
@ Palash Chaturvedi");
cprintf("\n\n\n\n");
textcolor(-12);
cprintf("\n\n\nPress any key to continue..");
textcolor(15);
getch();
return(0);
}

void main()
{

int ch1;
intro();
clrscr();
logo();

login();
do
{

clrscr();
cout<<"\n\n\t\t\t\t WELCOME";
cout<<"\n\n\n\n\n\t MAIN MENU";
cout<<"\n\t1. MAKE A PURCHASE";
cout<<"\n\t2. ADMIN MENU";
cout<<"\n\t3. EXIT";
cout<<"\n\t Please Select Your Option (1-3)";
cin>>ch1;
switch(ch1)
{
case 1: placeorder();
getch();
break;
case 2: adminmenu();
break;
case 3: {
clrscr();
goto K;
break;
}
default : cout<<"\a";
}
}
while(ch1>=1&&ch1<=3) ;
getch();
K:
last();
}

//END OF PROGRAM……!!!
OUTPUTS
BIBLIOGRAPHY

 Sumita Arora – class XI


 Sumita Arora – class XII
 www.wikipedia.com
Teachers Report

Name of the student - Palash Chaturvedi


Class - XII – A
Board Roll No. - 1673783
School - St. Joseph’s Co-Ed School, Bhopal
Topic - Shop Management

Teachers Remark

Anda mungkin juga menyukai