0% found this document useful (0 votes)
148 views33 pages

Computer Science Project: Book Shop Management

The document is a computer science project proposal for a book shop management system built using C++. It includes an overview of C++, system requirements, header files used, classes defined for books and the shop, functions like get_book_details() and modify_book(), and sample source code for the classes and functions. The project aims to manage purchasing, displaying, searching, modifying and deleting books in the shop's inventory to maximize customer satisfaction.

Uploaded by

Anjana Krishnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
148 views33 pages

Computer Science Project: Book Shop Management

The document is a computer science project proposal for a book shop management system built using C++. It includes an overview of C++, system requirements, header files used, classes defined for books and the shop, functions like get_book_details() and modify_book(), and sample source code for the classes and functions. The project aims to manage purchasing, displaying, searching, modifying and deleting books in the shop's inventory to maximize customer satisfaction.

Uploaded by

Anjana Krishnan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 33

COMPUTER SCIENCE PROJECT

BOOK SHOP MANAGEMENT

SUBMITTED
BY
KAMESH S

SRIMATHI SUNDARAVALLI MEMORIAL SCHOOL


Moppedu Road, Alapakkam, New Perungalathur
Chennai-600063

1|Page
C++ OVERVIEW

C++ is a statically typed, compiled, general-purpose, case-sensitive, free-form


programming language that supports procedural, object-oriented, and generic
programming.

C++ is regarded as a middle-level language, as it comprises a combination of


both high-level and low-level language features.

C++ was developed by Bjarne Stroustrup starting in 1979 at Bell Labs in


Murray Hill, New Jersey, as an enhancement to the C language and originally
named C with Classes but later it was renamed C++ in 1983.

C++ is a superset of C, and that virtually any legal C program is a legal C++
program.

Note: A programming language is said to use static typing when type checking
is performed during compiled-time as opposed during run-time.

C++ fully supports object-oriented programming, including the four pillars of


object-oriented development:

Encapsulation

Data hiding

Inheritance

Polymorphism is performed during compile-time as opposed to run-time.

The most important thing while learning C++ is to focus on concepts.

2|Page
The purpose of learning a programming language is to become a better
programmer; that is, to become more effective at designing and implementing
new systems and at maintaining old ones.

C++ supports a variety of programming styles. You can write in the style of
Fortran, C, Smalltalk, etc., in any language. Each style can achieve its aims
effectively while maintaining runtime and space efficiency.

Uses of C++:

C++ is used by hundreds of thousands of programmers in essentially every


application domain.

C++ is being highly used to write device drivers and other software that rely on
direct manipulation of hardware under real-time constraints.

C++ is widely used for teaching and research because it is clean enough for
successful teaching of basic concepts.

Anyone who has used either an Apple Macintosh or a PC running Windows has
indirectly used C++ because the primary user interfaces of these systems are
written in C++.

3|Page
SYNOPSIS

Our project ‘BOOK-SHOP MANAGEMENT’ is made out of turbo C++


language. It is a high-level programming language and its most important
feature is OOP concept and also in this project files have been used and
inheritance also included.

In this project the menu of the shop contains “To purchase books by the shop
management, to show all the books for the customer reference, to check the
availability of that particular book by searching by its number, to modify the
book, to delete a particular book by searching by its number.

So, the management was fully responsible and this was mainly made for the
benefit of the customers to properly select their book and if any defect in that
the main purpose of the management is that to replace it as well as to check if
any defects in the available stock of books and delete that.

So, after all the procedures made by the shop management then the book is
given to the customer with a cash memo to them and the main duty to duly hand
it over to the customers because in case of any defect, customers can get
replaced the defect one with new one. The customers get other major benefits
also.

The main motive of the management is to maximize the satisfaction of the


customers and gain maximum goodwill.

4|Page
SYSTEM REQUIREMENTS

Hardware:

Processor : intel core i5 .

Memory: 8 GB RAM.

System type: 64 bit operating system.

Software:

Application: Turbo C++, Microsoft Word.

OS Version: Windows 10.

5|Page
HEADER FILES

The C++ standard library contains files containing the standard functions that
your program may use.

The header file contains definition of function and variables, which is imported
or used into any C++ program by using the pre-processer directive.

It contains function signature like prototype, definition for library functions.


The variables are in-built in C++.

1.iostream.h:

C++ input/output streams are primarily defined by iostream, a header file that is
part of the C++ standard library (the name stands for Input/Output Stream).

2.conio.h:

It is a C header file used mostly by MS-DOS compilers to provide console


input/output. It is not part of the C standard library or ISO C, nor it is defined by
POSIX. This header declares several useful library functions for performing
"console input and output" from a program.

3.fstream.h:

Classes dealing with the input and output of data are called stream classes....
and objects of the class ofstream deal with output files. Objects fstream deal

6|Page
with files that can one can write to and read from. ofstream, ifstream, and
fstream are subclasses that are defined in the include file fstream.h.

4.stdio.h:

It is the header file for standard input and output. This is useful for getting the
input from the user (Keyboard) and output result text to the monitor(screen).

5.string.h:

It is the header in the C standard library for the C programming language which
contains macro definitions, constants and declarations of functions and types
used not only for string handling but also various memory handling functions;
the name is thus something of a misnomer.

6.iomanip.h:

It is a library that is used to manipulate the output of C++ program. These


functions may be conveniently used by C++ programs to affect the state of
iostream objects.

7.process.h:

It is a C header file which contains function declarations and macros used in


working with threads and processes. Most C compilers that target DOS,
Windows 3.1x, Win32, OS/2, Novell NetWare or DOS extenders supply this
header and the library functions in their C library.

7|Page
CLASSES

A class in C++ is a user-defined type or data structure declared with keyword


class that has data and functions (also called member variables and member
functions) as its members whose access is governed by the three access
specifiers private, protected or public. By default access to members of a C++
class is private.

A class that inherits another class is known as child class, it is also known as
derived class or subclass.

1.class book:

It is the base class which stores two data members (book_name, book_number)
in public visibility mode of data type char.

2.class shop:

It is the derived class which inherits the base class (class book) in public
visibility mode and also contains two data members (author_name, book_num).

8|Page
FUNCTIONS

A function is a block of code which only runs when it is called. You can pass
data, known as parameters, into a function. Functions are used to perform
certain actions, and they are important for reusing code: Define the code once,
and use it many times.

1.get_book_details ():

This function is used to get the information about the book that the buyer is
going to purchase such as book name, author name, book number and number
of copies.

2.modify_book ():

This function is used to modify the details of the existing book with new
information entered by the user.

9|Page
3.display_a_book ():

This function is used to check the availability of the the book that the user
requires.

4.delete_book ():

This function is used to delete the record of the book once it is been purchased.

5.show_book ():

This function is used to display the information of the book such as book name,
book number, author name and number of copies to the user.

6.write_book ():

This function is used to add newly purchased books information to the record.

7.display_allb ():

This function is used to display information about all the books available in the
store.

10 | P a g e
SOURCE CODE

#include<fstream.h>

#include<conio.h>

#include<string.h>

#include<iomanip.h>

#include<iostream.h>

#include<stdio.h>

#include<process.h>

class book

public:

char book_number[30];

11 | P a g e
char book_name[50];

};

class shop:public book

char author_name[20];

int num_copies;

public:

void get_book_details()

cout<<"\nENTER DETAILS ABOUT BOOK U WANT TO PURCHASE\n";

cout<<"\nEnter The Book Number: ";

cin>>book_number;

cout<<"\nEnter The Name of The Book: ";

cin.ignore();

cin.getline(book_name,50);

cout<<"\nEnter The Author's Name: ";

cin.ignore();

cin.getline(author_name,50);

cout<<"\nEnter No. Of Copies : ";

cin>>num_copies;

void show_book()

12 | P a g e
{

cout<<"\nBook Number: "<<book_number;

cout<<"\nBook Name: "<<book_name;

cout<<"\nAuthor's Name: "<<author_name;

cout<<"\nCOPIES : "<<num_copies;

void modify_book()

cout<<"\nBook number : "<<book_number;

cout<<"\nModify Book Name : ";

cin.ignore();

cin.getline(book_name,50);

cout<<"\nModify Author's Name: ";

cin.ignore();

cin.getline(author_name,50);

cout<<"\nEnter No. Of Copies : ";

cin>>num_copies;

char* getbooknumber()

return book_number;

13 | P a g e
void report()

{cout<<book_number<<setw(30)<<book_name<<setw(30)<<author_name<<s
etw(30)<<num_copies<<endl;}

};

fstream fp;

shop bk;

void write_book()

clrscr();

int more_or_main;

fp.open("book.dat",ios::out|ios::app);

do

bk.get_book_details();

fp.write((char*)&bk,sizeof(book));

cout<<"\nPress 1 to add more books.";

cout<<"\nPress 2 to return to main menu.\n";

cout<<"Enter: ";

cin>>more_or_main;

}while(more_or_main == 1);

fp.close();

14 | P a g e
void display_a_book(char n[])

clrscr();

cout<<"\nBOOK DETAILS\n";

int check=0;

fp.open("book.dat",ios::in);

while(fp.read((char*)&bk,sizeof(book)))

if(strcmpi(bk.getbooknumber(),n)==0)

bk.show_book();

check=1;

fp.close();

if(check==0)

cout<<"\n\nBook does not exist";

getch();

void modify_book()

15 | P a g e
clrscr();

char n[20];

int found=0;

cout<<"\n\n\tMODIFY BOOK";

cout<<"\n\n\tEnter The book number: ";

cin>>n;

fp.open("book.dat",ios::in|ios::out);

while(fp.read((char*)&bk,sizeof(book)) && found==0)

if(strcmpi(bk.getbooknumber(),n)==0)

bk.show_book();

cout<<"\nEnter The New Details of book"<<endl;

bk.modify_book();

int pos=-1*sizeof(bk);

fp.seekp(pos,ios::cur);

fp.write((char*)&bk,sizeof(book));

cout<<"\n\n\t Record Updated Successfully...";

found=1;

fp.close();

16 | P a g e
if(found==0)

cout<<"\n\n Record Not Found ";

getch();

void delete_book()

clrscr();

char n[20];

int flag=0;

cout<<"\n\n\n\tDELETE BOOK";

cout<<"\n\nEnter The Book's number You Want To Delete: ";

cin>>n;

fp.open("book.dat",ios::in|ios::out);

fstream fp2;

fp2.open("Temp.dat",ios::out);

fp.seekg(0,ios::beg);

while(fp.read((char*)&bk,sizeof(book)))

if(strcmpi(bk.getbooknumber(),n)!=0)

fp2.write((char*)&bk,sizeof(book));

17 | P a g e
else

flag=1;

fp2.close();

fp.close();

remove("book.dat");

rename("Temp.dat","book.dat");

if(flag==1)

cout<<"\n\n\tRecord Deleted ..";

else

cout<<"\n\nRecord not found";

getch();

void display_allb()

clrscr();

fp.open("book.dat",ios::in);

if(!fp)

cout<<"ERROR!!! FILE COULD NOT BE OPEN ";

getch();

18 | P a g e
cout<<"\n\n\t\tBook LIST\n\n";

cout<<"===================================================
=========================================\n";

cout<<"Book Number"<<setw(20)<<"Book
Name"<<setw(25)<<"Author"<<setw(25)<<"Copies"<<endl;

cout<<"===================================================
=========================================\n";

while(fp.read((char*)&bk,sizeof(book)))

bk.report();

fp.close();

getch();

void intro()

clrscr();

cout<<"\t\t\t\t*\t*";

cout<<"\t\t\t\t**\t**";

cout<<"\t\t\t\t***\t***";

cout<<"\t\t\t\t****\t****";

cout<<"\t\t\t\t*****\t*****";

19 | P a g e
cout<<"\t\t\t\t******\t******";

cout<<"\t\t\t\t*******\t*******";

cout<<"\t\t\t\t*******\t*******";

cout<<"\t\t\t\t******\t******";

cout<<"\t\t\t\t*****\t*****";

cout<<"\t\t\t\t****\t****";

cout<<"\t\t\t\t***\t***";

cout<<"\t\t\t\t**\t**";

cout<<"\t\t\t\t*\t*";

void main()

int option = 0;

for(;;)

intro();

cout<<"\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@";

cout<<"\n\t\tPress 1 to TO BUY";

cout<<"\n\t\tPress 2 to SHOW ALL BOOKS";

cout<<"\n\t\tPress 3 to CHECK AVAILABILITY";

cout<<"\n\t\tPress 4 to MODIFY BOOKS";

20 | P a g e
cout<<"\n\t\tPress 5 to DELETE BOOKS";

cout<<"\n\t\tPress 6 to Exit";

cout<<"\n\t\t@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
@@@@@@@@@@@@@@\n";

cout<<"\n\t\tOption: ";

cin>>option;

switch(option)

case 1: clrscr();

write_book();

break;

case 2: display_allb();

break;

case 3:

char num[20];

clrscr();

cout<<"\n\n\tPlease Enter The book No. ";

cin>>num;

display_a_book(num);

break;

case 4: modify_book();break;

case 5: delete_book();break;

21 | P a g e
case 6: exit(0);

break;

default:cout<<"\a";

OUTPUT

22 | P a g e
23 | P a g e
24 | P a g e
25 | P a g e
26 | P a g e
27 | P a g e
28 | P a g e
29 | P a g e
CONCLUSION

The following output drawn out of the project made would be very helpful for
the readers in this modern world for purchasing the book correctly and more
easily. The program is mainly created for the benefits of costumers. The
software is developed in modular approach for easy adaptability. It is capable of
accepting any changes with little alterations made in it.

30 | P a g e
FUTURE ENHANCEMENT

The program is capable of accepting many other alterations because of its


programmer friendly and user-friendly nature. As a conclusion this project is
highly flexible to glide over any situation, this makes the program close to the
real world.

This software can be easily implemented under various situations.

1.Any educational institute can make use of it for providing information about
author, content of available book in there library.

2.Modifications can be easily done according to requirements when necessary.

3.It can be used in type of book shop for managing all the sale and purchasing
activity and managing the data records related to book house.

31 | P a g e
BIBLIOGRAPHY

The project is made with the help of these references:

1.Computer science with C++ - Sumitha arora.

2.All in one Computer science class 12.

3.www.cppforschool.com

4.www.studiestoday.com

5.www.geeksforgeeks.com

32 | P a g e
33 | P a g e

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy