Thursday, December 9, 2010

OBJECT ORIENTED PROGRAMMING- BOOK STORE MANAGEMENT SYSTEM

OBJECT ORIENTED PROGRAMMING- BOOK STORE MANAGEMENT SYSTEM

TABLE OF CONTENTS

· INTRODUCTION OF OOPS & PROJECT

· DETAILS OF PROJECT

· SOURCE CODE

· SNAPSHOT

· LIMITATIONS

· FUTURE SCOPE

· BIBLIOGRAPHY

INTRODUCTION OF OOPS & BOOK STORE

Object Oriented Programming, also known as OOP, is a computer science term which is used to describe a computer application that is composed of multiple objects which are connected to each other. Traditionally, most computer programming languages were simply a group of functions or instructions. With OOP, every object can handle data, get messages, and transfer messages to other objects. The objects will all act as independent units in their own right, and they will be responsible for carrying out a certain process.
Because the objects are not dependent on each other, OOP is seen as being more flexible than older methods of programming. It has become quite popular, and it is now used in a number of advanced software engineering projects. Many programmers feel that object oriented programming is easier for beginners to learn than previous programming methods. Because it is easier to learn, it can also be analyzed and maintained without a large amount of difficulty. However, there are some people that feel that OOP is more complicated than older programming methods. To understand object oriented programming, there are a few concepts you will need to become familiar with.The first concept that you will need to learn is called a "class."

A bookshop maintains the inventory of books.The list include such as: author,title,price,publisher & stock position,Whenever a customer wants a book a sales person input the title & author.Anotjer system searches the list & displays whether it is available or not.If it isnot,an appropriate message is displayed,if is then the system displays the book details & request,then the no. of copies required. If the required copies are available the total cost of requested copies is displayed otherwise an appropriate message is dispayed.Also incorporate the points noted below (i)the stock value of each book should be automatically updated as soon as traansaction is completed. (ii)the no. of succcessful & unsuccessful transaction should be recorded for purpose of statistical analysis.Use static data members to keep count of no. of transactions.It can be used to manage records of the issued books , books available ,etc.It has function overloading, inheritance , polymorphism and data file handling as its basiss for coding along with some graphics.

DETAILS OF PROJECT

Classes-:

Class-based object oriented programming is a style that gains inheritance by processing classes as objects. The most prominent style of OOP is class-based instead of object-based. With the class-based OOP system, objects are units that merge states, identities, and behaviors.

Functions-:

Member functions are operators and functions that are declared as members of a class. Member functions do not include operators and functions declared with the friend specifier. These are called friends of a class. You can declare a member function as static; this is called a static member function. A member function that is not declared as static is called a nonstatic member function.

Arrays-:

An array is a collection of objects of the same data type. Individual objects in an array, called elements, are accessed by their position in the array. The subscripting operator ([]) provides the mechanics for creating an index to array elements. This form of access is called indexing or subscripting. An array facilitates the coding of repetitive tasks by allowing the statements executed on each element to be put into a loop that iterates through each element in the array.

Strings-

In the C++ programming language, the std::string class is a standard representation for a string of text. This class removes many of the problems introduced by C-style strings by putting the onus of memory ownership on the string class rather than on the programmer. The class provides some typical string operations like comparison, concatenation, find and replace, and a function for obtaining substrings. It can be constructed from a C-style string, and a C-style string can also be obtained from it.

Purpose & scope

Purpose:-The purpose of this application are as follows :

1.The software is for automation of book store.

2.It provides following facilities to

Operator :

1.Can enter details related to a particular book.

2.Can provide membership to members.

Admin :

1.Can read and write information about any

member.

2.Can update, create, delete the record of

membership as per requirement and implementation

plants.

Scope :

The different areas where we can use this application

are :

1. Any education institute can make use of it for

providing information about author, content of the

available books.

2. It can be used in offices and modifications can be

easily done according to requirements.

Technology Used :

C++

Assumptions

1. This application is used to convert the manual

application to the online application.

2. Customized data will be used in this application.

3. User does not have right to enter information

about books.

SOURCE CODE

#include

#include

#include

#include

#include

#include

#include

void normalwindow()

{

clrscr();

}

void winup()

{

clrscr();

}

void wincenter()

{

clrscr();

}

void windown()

{

clrscr();

}

void text()

{

gotoxy(3,2);

cputs("* PROG. BY ANURAG THAKUR * ");

gotoxy(50,3);

cputs("TEACHER:* MISS PREETI SIKKA * ");

gotoxy(53,5);

cputs(" ---------x-------- ");

gotoxy(3,4);

cputs("*STUDENT OF LOVELY SCHOOL OF SCIENCE* ");

gotoxy(53,4);

cputs("Faculty of Electronics and comm. ");

gotoxy(2,5);

cputs(" ---------x-------- ");

}

void tex_input()

{

clrscr();

void read_file();

gotoxy(30,8);

cputs("*** ADD NEW RECORD ***");

gotoxy(8,10);

cputs(" Book's Title: ");

gotoxy(72,10);

cputs(" ");

gotoxy(8,11);

cputs(" ");

gotoxy(8,12);

cputs(" Book's ID: ");

gotoxy(46,12);

cputs(" Date: ");

gotoxy(72,12);

cputs(" ");

gotoxy(8,13);

cputs(" ");

gotoxy(8,14);

cputs(" Author: ");

gotoxy(72,14);

cputs(" ");

gotoxy(8,15);

cputs(" ");

gotoxy(8,16);

cputs(" Category: ");

gotoxy(72,16);

cputs(" ");

gotoxy(8,17);

cputs(" ");

gotoxy(8,18);

cputs(" Value of Book:") ;

gotoxy(72,18);

cputs(" ");

gotoxy(8,19);

cputs(" ");

gotoxy(8,20);

cputs(" Book's Price: ");

}

void tex_output()

{

clrscr();

gotoxy(27,8);

cputs("*** DISPLAY BOOK IN STOCK ***");

gotoxy(4,9);

cputs(" ");

gotoxy(4,10);

cputs(" S.NO: Book ID : Book Title or Name : Quan: Price : Total: ");

}

void tex_sell()

{

clrscr();

gotoxy(27,8);

cputs("*** DISPLAY BOOK OUT STOCK ***");

gotoxy(4,9);

cputs(" ");

gotoxy(4,10);

cputs(" S.NO; Book ID : Book Title or Name: Quan : Price: Total: ");

}

struct lib{

char name[80];

char id[5];

char author[20];

char date[11];

short int number;

char category[20];

float cost;

float total;

};

class library{

protected:

lib book[200];

static int count;

static int index;

public:

library();

~library()

{cout<<"Done";}

void book_sell();

void write_file();

void input_data();

void output_data();

void find_count();

void find_book();

void search_book();

void delete_book();

void scand_book();

void sort_book();

void sort_sell();

void out_book();

void read_file();

};

int library::count=-1;

int library::index=119;

library::library()

{

for(int i=0;i<200;i++)

{

strcpy(book[i].name,"");

strcpy(book[i].id,"");

strcpy(book[i].author,"");

strcpy(book[i].date,"");

strcpy(book[i].category,"");

book[i].number=0;

book[i].cost=0;

book[i].total=0;

}

}

void library::find_count()

{

clrscr();

for(int i=0;strcmp(book[i].id,"")!=0;i++);

count = i - 1;

for(int j=120;strcmp(book[j].id,"")!=0;j++);

index = j - 1;

}

void library::read_file()

{

ifstream infile;

infile.open("book.db", ios::nocreate);

if(infile)

infile.read((char*)this,sizeof(*this));

}

void library::write_file()

{

clrscr();

ofstream outfile;

outfile.open("book.DAT");

if(outfile){

outfile.write((char*)this,sizeof(*this));

}else{

cout<<"\n Cannot Open This file! \n";

exit(1);

}

outfile.close();

}

void library::input_data()

{

gotoxy(27,10);

gets(book[++count].name);

id_con:

gotoxy(27,12);

gets(book[count].id);

if((strlen(book[count].id))<4>4){

gotoxy(27,12);

cout << " ";

goto id_con;

}

gotoxy(61,12);

gets(book[count].date);

gotoxy(27,14);

gets(book[count].author);

gotoxy(27,16);

gets(book[count].category);

gotoxy(27,18);

cin >> book[count].number;

gotoxy(27,20);

cin >> book[count].cost;

cin.get();

book[count].total = book[count].number * book[count].cost;

scand_book();

}

void library::book_sell()

{

clrscr();

char subject[10], ch;

int change, too, taa=0;

float price;

play:

normalwindow();

text();

gotoxy(20,11);

cputs(" Enter Book's ID : ");

gotoxy(20,12);

cputs(" ");

gotoxy(42,11);

cin >> subject;

for(int i=0;i<=count;i++){

if(strcmp(book[i].id, subject)==0){

too = i;

taa = 1;

}

}

if(taa==1)

{

gotoxy(8,14);

cputs(" ");

gotoxy(8,15);

cputs("Book ID : Book Title or Name: Quan: Price: Total: ");

gotoxy(8,16);

cputs(" ");

gotoxy(8,17);

cputs(" ");

gotoxy(8,18);

cputs(" ");

gotoxy(11,17);

cputs(book[too].id);

gotoxy(22,17);

cputs(book[too].name);

gotoxy(53,17);

cout<

gotoxy(59,17);

cout<

gotoxy(67,17);

cout<

gotoxy(12,20);

cputs(" ");

gotoxy(12,21);

cputs(" HOW MANY BOOK DO YOU WANT TO SELL : AND COST: ");

gotoxy(12,22);

cputs(" ");

Again:

gotoxy(51,21);

cin >> change;

if(change>book[too].number){

gotoxy(51,21);

cout<<" ";

goto Again;

}else{

gotoxy(65,21);

cin >> price;

book[too].number = book[too].number - change;

if(book[too].number==0){

strcpy(book[++index].id,book[too].id);

strcpy(book[index].name,book[too].name);

strcpy(book[index].date,book[too].date);

strcpy(book[index].author,book[too].author);

strcpy(book[index].category,book[too].category);

book[index].number = change;

book[index].cost = price;

book[index].total = book[index].number * book[index].cost;

strcpy(book[count].id,"");

}else{

book[too].number = book[too].number;

book[too].cost = book[too].cost;

book[too].total = book[too].number * book[too].cost;

strcpy(book[++index].id,book[too].id);

strcpy(book[index].name,book[too].name);

strcpy(book[index].date,book[too].date);

strcpy(book[index].author,book[too].author);

strcpy(book[index].category,book[too].category);

book[index].number = change;

book[index].cost = price;

book[index].total = book[index].number * book[index].cost;

}

}

}

if(taa==0)

{

gotoxy(20,10);

cputs(" ");

gotoxy(20,11);

cputs(" Invalid Book's ID ");

gotoxy(20,12);

cputs(" ");

gotoxy(18,15);

cputs(" Do you want to quit or continue (y/n). ");

ch= toupper(getch());

}

if(ch == 'Y') goto play;

}

void library::output_data()

{

clrscr();

if(count==-1)

{

gotoxy(20,10);

cputs(" ");

gotoxy(20,11);

cputs(" NO DATA IN STOCK ");

gotoxy(20,12);

cputs(" ");

}

else

{

tex_output();

int change=12;

for(int i=0;i<=count;i++){

gotoxy(7,change+i);

cout<

gotoxy(13,change+i);

cputs(book[i].id);

gotoxy(25,change+i);

cputs(book[i].name);

gotoxy(56,change+i);

cout<

gotoxy(62,change+i);

cout<

gotoxy(70,change+i);

cout<

if((i+1)%8==0)

{

gotoxy(30,22);

cputs(" Press any key to Continue...");

getch();

change = change - 8;

tex_output();

}

}

}

getch();

}

void library::out_book()

{

clrscr();

if(index==119)

{

gotoxy(20,10);

cputs(" ");

gotoxy(20,11);

cputs(" NO DATA OUT STOCK ");

gotoxy(20,12);

cputs(" ");

}else{

tex_sell();

int change=11;

int plus=0;

for(int i=120;i<=index;i++){

plus++;

gotoxy(7,change+plus);

cout<

gotoxy(13,change+plus);

cputs(book[i].id);

gotoxy(25,change+plus);

cputs(book[i].name);

gotoxy(56,change+plus);

cout<

gotoxy(62,change+plus);

cout<

gotoxy(70,change+plus);

cout<

if((i+1)%8==0)

{

gotoxy(30,22);

cputs(" Press any key to Continue...");

getch();

change = change - 8;

tex_output();

}

}

}

getch();

}

void library::find_book()

{

clrscr();

char subject[10], ch;

int taa=0, too;

play:;

normalwindow();

text();

gotoxy(20,10);

cputs(" ");

gotoxy(20,11);

cputs(" Enter Book's ID : ");

gotoxy(20,12);

cputs(" ");

gotoxy(42,11);

cin >> subject;

for(int i=0;i<=count;i++){

if(strcmp(book[i].id, subject)==0){

too = i;

taa = 1;

}

}

if(taa==1)

{

gotoxy(8,15);

cputs("Book ID : Book Title or Name: Quan: Price : Total: ");

gotoxy(11,17);

cputs(book[too].id);

gotoxy(22,17);

cputs(book[too].name);

gotoxy(53,17);

cout<

gotoxy(59,17);

cout<

gotoxy(67,17);

cout<

getch();

}

if(taa==0)

{

gotoxy(20,11);

cputs(" Invalid Book's ID ");

gotoxy(18,15);

cputs(" Do you want to quit or continue (y/n). ");

ch= toupper(getch());

}

if(ch == 'y') goto play;

}

void library::scand_book(){

for(int i=0;i<=count-1;i++){

if(strcmp(book[i].id,book[count].id)==0){

strcpy(book[i].id,book[count].id);

strcpy(book[i].name,book[count].name);

strcpy(book[i].date,book[count].date);

strcpy(book[i].author,book[count].author);

strcpy(book[i].category,book[count].category);

book[i].number = book[i].number + book[count].number;

book[i].cost = book[i].cost;

book[i].total = book[i].total + book[count].total;

strcpy(book[count].id,"");

}

}

}

void library::delete_book()

{

char subject[10], ch;

int taa=0, too;

play:

normalwindow();

text();

gotoxy(20,11);

cputs(" Enter Book's ID : ");

gotoxy(42,11);

cin >> subject;

for(int i=0;i<=count;i++)

{

if(strcmp(book[i].id, subject)==0)

{

too = i;

taa = 1;

}

}

if(taa==1)

{

gotoxy(8,15);

cputs("Book ID : Book Title or Name : Quan ; Price : Total : ");

gotoxy(11,17);

cputs(book[too].id);

gotoxy(22,17);

cputs(book[too].name);

gotoxy(53,17);

cout<

gotoxy(59,17);

cout<

gotoxy(67,17);

cout<

gotoxy(20,21);

cputs(" Do you want delete this book (y/n) ");

ch=toupper(getch());

if(ch=='Y')

{

strcpy(book[too].id,book[count].id);

strcpy(book[too].name,book[count].name);

strcpy(book[too].date,book[count].date);

strcpy(book[too].author,book[count].author);

strcpy(book[too].category,book[count].category);

book[too].number = book[count].number;

book[too].cost = book[count].cost;

book[too].total = book[count].total;

strcpy(book[count].id,"");

}

}

if(taa==0)

{

gotoxy(20,11);

cputs(" Invalid Book's ID ");

gotoxy(18,15);

cputs(" Do you want to quit or continue (y/n). ");

ch=toupper(getch());

}

if(ch == 'Y') goto play;

}

void library::sort_book()

{

lib temp;

for(int i=1;i<=count;i++)

{

temp=book[i];

for(int j=i-1;j>=0 && (strcmpi(temp.id,book[j].id)<0);j--)

book[j+1]=book[j];

book[j+1]=temp;

}}

void main()

{

clrscr();

char ch;

library book;

again:;

book.read_file();

book.find_count();

text();

int num;

gotoxy(20,11);

cputs(" $$ LOVELY BOOK SHOP $$ ");

gotoxy(26,13);

cputs("press 1 to add book to stock");

gotoxy(26,14);

cputs("press 2 to sell book from stock");

gotoxy(26,15);

cputs("press 3 to View Book Sold so far");

gotoxy(26,16);

cputs("press 4 toView Book In Stock ");

gotoxy(26,17);

cputs("press 5 to Search Book In Stock");

gotoxy(26,18);

cputs("press 6 Delete Book From Stock ");

gotoxy(26,19);

cputs("press 7 to Exit ");

gotoxy(26,20);

cputs("enter choice:");

cin>>num;

do

{

switch(num)

{

case 1:

text();

tex_input();

book.input_data();

book.sort_book();

book.write_file();

goto again;

case 2:

text();

book.write_file();

book.book_sell();

goto again;

case 3:

text();

book.out_book();

goto again;

case 4:

text();

book.output_data();

goto again;

case 5:

text();

book.find_book();

goto again;

case 6:

text();

book.delete_book();

book.write_file();

goto again;

default:

cout<<"********THANK YOU MAM********";

}

}

while(num!=7);

getch();

}

SNAPSHOTs

CASE 1

CASE 2

CASE 3

CASE 4

CASE 5

CASE 6

CASE 7

HARDWARE &SOFTWARE REQUIREMENTS

1. Turbo c++

2. Storage device

3. 128mb mem

4. Compatible windows

SOFTWARE SCOPE:

1. Extensibility: This software is extendable in ways that its original

developers may not expect. The following principles enhances

extensibility like hide data structure, avoid traversing multiple

links or methods, avoid case statements on object type and

distinguish public and private operations.

2. Reusability: Reusability is possible as and when require in this

application. We can update it next version. Reusable software

reduces design, coding and testing cost by amortizing effort

over several designs. Reducing the amount of code also

simplifies understanding, which increases the likelihood that

the code is correct. We follow up both types of reusability:

Sharing of newly written code within a project and reuse of

previously written code on new projects.

3. Understandability: A method is understandable if someone other

than the creator of the method can understand the code (as

well as the creator after a time lapse). We use the method,

which small and coherent helps to accomplish this.

4. Cost-effectiveness: Its cost is under the budget and make within

given time period. It is desirable to aim for a system with a

minimum cost subject to the condition that it must satisfy the

entire requirement.

Scope of this document is to put down the requirements, clearly

identifying the information needed by the user, the source of the

information and outputs expected from the system.

LIMITATION & FUTURE SCOPE

.

Book Shop recognizes the need for consumers to control the use and management of personal information. By personal information we mean information that can be used to identify or contact an individual. This may include, but is not limited to, a first and last name, a physical address, an e-mail address, a student ID number, or a phone number. If you are visiting our site to browse or find information about Luther Book Shop’s products or services, you do not need to provide any personal information. If you decide to make a purchase, however, we may collect this information so that we can provide you with the product or service you requested.

Book Shop uses personal information provided by you so that we can service your account. Also note that we may need to transfer that information to our agents or employees of our service providers. We will not sell or trade your information to unrelated third parties. When you submit an order you will receive an e-mail confirmation from our system. As your order status changes you may also receive notifications via e-mail. These notifications are considered part of our service and may not be disabled. We may also periodically send you e-mail notifications concerning products or services. Any such notification will include instructions for opting out of future mailings.

Bookstore will not be liable for damages resulting from any failure caused by events beyond its control, by any act of God, such as a power failure, or by any other cause not within the control of Bookstore.

BIBLIOGRAPHY

1. www.fixya.com/.../t2082822-book_shop_management_system

2. www.daniweb.com

3. www.vclcomponents.com/...__/report_for_bookstore_management_system

4. www.topshareware.com/book-store-management-system.../1.htm

5. www.sourcecodeonline.com/list?...book_store_management_system

No comments:

Post a Comment