Thursday, September 10, 2009

Library Management Systems

Library Management System in C Plus Plus


Library Management Systems Today we will see how we can code Library Management System using our favorite computer language C ++.

Tools Require:
Turbo C  for 32-bit computer( Download & Install C)

LMS.cpp

Download 
Introduction:
Before moving forward, any further, we need to answer three very pertinent questions:
Q1)What we are doing?
We are building a Library management system(LMS) using the C Plus Plus language using  Turbo C and various header libraries available to us.

Q2)What we are going to achieve? and
We will get a fully functional system using which we can manage our school Library.

Q3)How we will do it?
We will break this program in three parts to understand it better. In the first part, we will discuss header files and their uses, in the second part we will see how many classes we are using and in the third part we will look into the implementation of our Library Management System.


Header files:
Now we will learn some basic information about header files we are going to use in this project:

#include<fstream.h> 
#include<conio.h>
#include<stdio.h>
#include<process.h>
#include<string.h>
#include<iomanip.h>

fstream.h: 
This class is used to read and write data streams from/to files. There are two more similar classes like fstream class which are ofstream and ifstream, one is used only for writing and the other one is used for only reading.

Why we need this header file in our program?

We are storing our data inside .dat extension files, to store and retrieve this data we will need this class

conio.h:
It is a C header file to create input-output interfaces. Though it is not a part of standard C Library, still it is very useful and used in various programs.

We are including this library because in our program we have used various functions which are part of it such as getch() , clrscr(), etc .

stdio.h:
Standard input-output library.

It is useful to get data from the user and also showing output.

process.h:
It is a C header file that contains function declarations and macros used in working with threads and processes.

string.h:
This header file helps us to work with strings. For example concatenation, copying, etc.

iomanip.h:
It helps us to manipulate output formatting. For example precision of floating-point values.

Some library functions we will use in this program:

strcmpi() : Compare strings without case sensitivity and return 0 when they are equal, for example, if we pass two strings(india and India) into this function, it compares and returns 0 because it will convert both these strings into lowercase and then compare.

setw() : Set the number of character to be used in next insertion

Objects:


We are going to use three global objects to access the functions of our classes:

fstream file_pointer,filepointer1;
book book_object;
student student_object;

Structure of a Program:

1) Book
                
2) Student



No comments:

Post a Comment