Vous êtes sur la page 1sur 147

COLLEGE MANAGEMENT

Submitted in partial fulfillment of requirements for the award of the degree

Bachelor of Technology in Information Technology

Guide:

submitted by:

Mrs Sarika Jain

Ankit Singhal [17017] Anupam Srivastava [17019] Deepak Singh Rawat [17025] Mohit Vohra [17045] Mukul Aggarwal [17047]

Amity School of Engineering and Technology Amity University, Noida (U.P) (2006-2010)

ACKNOWLEDGEMENT

Our foremost and profound gratitude goes to MRS Sarika Jain for her proficient and enthusiastic guidance and encouragement. The suggestions given undoubtedly helped in supplementing our thoughts in the right directions for attaining the desired objective .

Our heartfelt gratitude also goes to all the faculty members and staff of Amity School of Engineering, Amity University who have contributed directly or indirectly towards the successful completion of this report.

Ankit Singhal [17017] Anupam Srivastava [17019] Deepak Singh Rawat [17025] Mohit Vohra [17045] Mukul Aggarwal [17047]

Certificate of Originality

This is to certify that the project report (IT) entitled COLLEGE MANAGEMENT done by Ankit Singhal, Anupam Srivastava, Deepak Singh Rawat, Mohit Vohra, Mukul Aggarwal,Roll no 17017, 17019, 17025, 17045, 17047 is an authentic work carried out by them at Amity school of engineering under my guidance. The matter embodied in this project work has not been submitted earlier for the award of any degree or diploma to the best my knowledge and belief.

Date:

Signature of the guide Ms. Sarika Jain

Synopsis

Project Title :- COLLEGE MANAGEMENT Platform used :- C with Graphics

PRESENTED BY :Ankit singhal - (17017) Anupam srivastava - (17019) Deepak singh rawat - (17025) Mohit vohra - (17045) Mukul aggarwal ( 17047)

A word about C
C is a programming language developed at AT & Ts Bell Laboratories of USA in 1972.Its popularity can be accounted to its reliability, simplicity and ease to use .It was designed and written by Dennis Ritchie. It can be said that it is a core language ,that is one has to learn basic features of C before learning any other language .It is used in major parts of operating systems like Windows ,UNIX ,Linux .When it comes to performance ,or speed of operation nothing beats C. Moreover , if one is to extend the operating system to work with new devices one needs to write device driver programs ,which are also written in C. Mobile Devices like cellular phones ,palmtops .These modern devices use microprocessors ,an operating system and a program embedded in this devices. C is the choice while building such operating systems and programs. At times one is required to very closely interact with the hardware devices .Since C provides several language elements that make this interaction feasible without compromising the performance.

Why using C ? C is the language of our choice due to better command over the language .We are familiar with almost all the features of the language .It is the language of choice for all the programmers due to its ease of use, simplicity and reliability. It is a language with better performance and speed of operation. The essence of our project is speed , reliability, user friendly ,so that the customer can easily interact with the menus given and can select the destination of choice as fast as possible ,without any ambiguity .To match the expectation of the customer the program has to react fast to the user inputs like the availability of transportation or accommodation to the desired place .This is where C language scores over other languages.

Problem Definition

The problem definition is the first document which is normally prepared by client .It only gives superficial view of the system as per clients perspective and expectations. It is the input to requirement engineering process where final product is the SRS. The problem definition of COLLEGE MANAGEMENT SYSTEM is given below: (A) STUDENT PERSONAL DETAILS Database administrator enters the student personal details that is, NAME, FATHERS NAME, MOTHERS NAME, DATE OF BIRTH. Students ROLL NUMBER, CURRENT YEAR, AND COURSE are also entered in the database. (B) SUBJECT DETAILS Database administrator enters the subject details that is, a student can have any number of subjects, subject name. There is no constraint on entering the number of subjects, since it depends on the course of the student and current year. (C) RESULT DETAILS It manages information about marks and percentage obtained by students in different years. It also display mark sheets, when students roll number is entered. (D) ISSUE DETAILS A student can issue two books at a time from the library. There is no constraint in duration for which book is issued. (E) STAFF DETAILS It mainly includes teachers information. This part mainly focuses on the subject assigned to different teachers. It also includes salary management of teachers. (F) DELETE, UPDATE, SAVE AND DISPLAY DETAILS A student can delete, update, save old details as well as can enter new details. It can also display details of student individually. It can be accessed and manipulated through the password and roll number of student. (G) PASSWORD ACCESS A password is given to COLLEGE MANAGEMENT SYSTEM in order to protect it from unauthorized access.

Software Requirement Specification

1. INTRODUCTION
This document aims at defining the overall software requirements for COLLEGE MANAGEMENT SYSTEM . Efforts have been made to define the requirements exhaustively and accurately. The final product will be having only features/functionalities mentioned in this document and assumptions for any additional functionality/features should not be made by any of the parties involved in developing/testing/implementing/using this product. In case it is required to have some additional features, a formal change request will need to be raised and subsequently a new release of this document and/or product will be produced.

1.1. Purpose
This Software Requirements Specification provides a complete description of all the functions and constraints of the COLLEGE MANAGEMENT SYSTEM, developed for the University. The expected audience of this document includes administrator in the Department of University who will use the system, the software developer and persons desiring a model for software development documentation.

1.2 Scope of Project


We describe what features are in the scope of the software and what are not in the scope of the software to be developed.

In Scope:
a. Managing records of multiple students, which would include maintaining results information , subjects information, bookkeeping information about entities like Transaction. b. Managing records of staff members (teachers , workers , etc). c. Features like creating, deleting ,editing ,searching records. d. Password bound that is, does not support unauthorized access to data.

Out of Scope:
a. Web access .

1.3 Definitions, Acronyms, and Abbreviations:

SRS : SOFTWARE REQUIREMENT SPECIFICATIONS. B.TECH: BACHELORS OF TECHNOLOGY. M.TECH: MASTRES OF TECHNOLOGY. BSC : BACHELORS OF SCIENCES. MSC : MASTERS OF SCIENCES.

1.5 Overview of Document


This document contains two chapters. The first is designed to understand the students database in the University. It lists all the functions performed by the system and the constraints under which it is to operate. The second chapter list details of staff members to define the product fully for the software developer. The two lists of functions are crossreferenced to allow easy comparison.

2. OVERALL DESCRIPTION
The COLLEGE MANAGEMENT SYSTEM is capable of maintaining information about students personal details, result management details, book issue details, teachers details, subject details. It is also capable of updating, deleting and saving the details. The software will also generate mark lists and percentage of marks obtained by students individually.

Front end client application

Backend database

2.1 PROUCT PERSPECTIVE


The application is window-based, self contained software product.

2.1.1 SYSTEM INTERFACE


None

2.1.2 USER INTERFACE


The application will have a user-friendly and menu based interface. Following screens will be provided: (1) A login screen for entering the password will be provided . (2) There is a screen for entering and displaying information regarding what all subjects are offered during which semester, how many percentage scored during semester. (3) There is a screen for entering and displaying information regarding various students personal and courses during different semester. (4) There is a screen for entering and displaying the information regarding teachers subject assigned and there salary details. (5) There is a screen for entering and displaying the information regarding number of books issued and details of fine(if any).

2.1.3 HARDWARE INTERFACE


Screen resolution of at least 800 * 600 required for proper and complete viewing of screens. Higher resolution would not be a problem.

2.1.4 SOFTWARE INTERFACE


Any windows- based operating system (windows 95/98/2000/XP/NT). TC-for running the software.

2.1.5 COMMUNICATION INTERFACES


None

2.1.6 MEMORY CONSTRAINTS

At least 256 MB RAM and 80 GB space on hard disk will be required for running the application.

2.1.7 OPERATIONS
The product release will not cover any automated housekeeping aspects of the database. The DBA at the client site (i.e., university) will be responsible for manually deleting old/non-required data. Database backup and recovery will also have to be handled by DBA.

2.1.8 SITE ADAPTION REQUIREMENTS


The terminals at the client site will have to support the hardware and software interfaces specified in above sections.

2.2 PRODUCT FUNCTIONS


The system can be accessed only by DBA. Depending on the roll number of the he/she can access his/her details. A summary of the major functions that the software will perform: Password access. Entering the details. Deleting the details. Updating the details. Saving the details. Searching the details. Displaying the details.

2.3 USER CHARACTERSTICS

EDUCATIONAL LEVEL: At least graduate should be comfortable with English language. EXPERIENCE: Should be well versed/informed about the course structure of COLLEGE. It includes subject information, result management, teachers details.

TECHNICAL EXPERIENCE: 1. Should be comfortable using general purpose applications on a computer. 2. Should have experience of working in TC(c/c++) complier.

2.4 CONSTRAINTS
1. Since the DBMS being used in TC compiler, it will not be able to store huge number of records. 2. Due to limited features of DBMS being used performance tuning features will not applied to the queries and thus the system may become slow with increase number of records being stored. 3. Security policy is restricted to only to DBA.

2.5 ASSUMPTIONS AND DEPENDENCIES


1. The number of subjects in a particular course per year should be less than 10. 2. The number of books that can be issued at a time should be less than 2.

2.6 APPORTIONING OF REQUIREMENTS


Not required.

SPECIFIC REQIREMENTS

This section contains the software requirements to a level of detail sufficient to enable designers to design the system, and testers to test that system.

3.1 EXTERNAL INTERFACE REQUIREMENTS USER INTERFACE


The following screens will be provided: Menu screen: This will be the first screen that will be displayed. It will allow user to perform following operation: 1. Enter Records 2. Display Records

3. Search Records 4. Library 5. Result Enter records screen: This screen will allow user to enter personal details, subject information details.various fields available on this screen will be: 1. 2. 3. 4. 5. 6. NAME: length upto 30 characters. FATHER NAME: length upto 30 characters. MOTHERS NAME: length upto 30 characters. ROLL NO.: take integer values. COURSE: length upto 30 characters. YEAR: take integer values.

Display records screen: This will display the details of student according to there roll number. Search records screen: This will search the record of the entered roll number. Library screen: This screen contains information about the details of library .Various fields associated with this screen: 1. CARD NUMBER: number of cards are 2 per student. 2. DATE, MONTH, YEAR: shows date of issue of the book. Result screen: This screen displays result of student according to there roll number.

3.2 SYSTEM FEATURES 3.2.1 STUDENT INFORMATION MAINTENANCE


DESCRIPTION: The system will maintain information about various subjects being offered during

different years of course, personal detail, course detail, library detail. The system will allow creation/modification/deletion of new / existing details. VALIDITY CHECKS: 1. Only administrator will be authorized to access the student information maintenance schedule. 2. Student roll number will be unique for every student. 3. Student name cannot be left blank. 4. Subject name cannot be left blank. SEQUENCING INFORMATION: Subject info for a particular year will have to be entered in the system before any student marks information for that year can be entered. ERROR HANDLING: If any of the above validations / sequencing flow does not hold true , appropriate error message will be prompted. 3.2.2 TEACHER INFORMATION MAINTENANCE DESCRIPTION: The system will maintain information about teachers name, department and his / her salary details. The system will be allowed to create, modify and deletion of new/ existing details. VALIDITY CHECKS: 1. Only administrator will be authorized to teachers information maintenance module. 2. Every teacher should have unique id number. 3. Teacher name cannot be blank. SEQUENCING INFORMATION: Teachers name and id will have to be entered in the system before any department and salary details. ERROR HANDLING: If any of the above validation / sequencing flow does not hold true , appropriate error messages will be prompted to the user for doing the needful.

3.3 PERFORMANCE REQUIREMENTS


None

3.4 DESIGN CONTRAINTS


The system should have TC in order to run the software.

3.5 SOFTWARE SYSTEM ATTRIBUTES 3.5.1 SECURITY


The application is password protected .User will have to enter the correct id and password in order to access the application.

3.5.2 MAINTAINABILITY
The application is designed in maintainable manner. It will be easy to incorporate new requirements in the individual modules ( personal info, subject info, result info, teachers info).

3.5.3 PORTABILITY
The application will be easily portable on any windows-based system that has TC (c/c++) compiler.

3.6 LOGICAL DATABASE REQUIREMENTS


The following information will be placed in a database: 1. Personal details: name, fathers name, mothers name, date of birth, roll number, number of subjects, year. 2. Subject details: subject name, subject code. 3. Result details: marks, percentage. 4. Issue details: card number, date. 5. Teachers details: name, salary, subject.

3.7 OTHER REQUIREMENTS


None.

Disadvantages of the Current System And Advantages Of The Proposed System

Advantages
a. Managing records of multiple students, which would include maintaining results information , subjects information, bookkeeping information about entities like Transaction. b. Managing records of staff members (teachers , workers , etc). c. Features like creating, deleting ,editing ,searching records. d. Password bound that is, does not support unauthorized access to data.

Disadvantages
a. Web access

Gantt Chart

Y X

RELEASE 1

RELEASE 2

0 6

NUMBER OF WEEKS

X : During the first week of our project , we decided on the subject on which we our going to make project. Y: During the second and third week ,we made the basic logic of creation , insertion , deletion, updating of data in file. Z: In the fourth week , we included students detail and teachers detail. RELEASE 1: During the fifth week , we introduced password authentication. RELEASE 2: During sixth week , we fixed all the bugs from previous release.

Hardware And Software Requirements Hardware Minimum System Requirements


1. 2. 3. 4. Processor : x86 , 32 BIT RAM : 128 MB 640*480 Resolution Monitor Standard Keyboard

Recommended System Requirements


1.RAM:256 MB

Software Minimum System Requirements


1..DOS Operating System

Data Flow Diagram


Level 0 DFD Data Entry Operator Library Operation Marks Operation

Student Marks Personal Detail Detail

Student Academic Detail

Books Detail

College management Administrator User Account Maintenance

Library Details Reports Generated Student Personal Info Reports Generated Mark sheet Generate Student Academic Info Reports Generated

Data Flow Diagram


Level 1 DFD Enter Password Marks Details Teacher Report Library Management

Subject Information

Books Information

Student Academic Info Management

Student Academic Info Enter No. of Subjects Data Entry Operator Student Personal Info Management

Log 2 User Account Info Personal Information Enter Password Account manageme nt

Administrator 4

Data Diagram
Level 2 DFD 1. User Account Maintenance

Administrator

Enter /Update/Delete User Info

Display User Account Info

User Account Info

Validate Process User Info

User Info

Data Diagram
Level 2 DFD 2.Login

User Account Information

Data Entry Operator

Enter ID,Password

Login

Enter ID,Password Coordinator

Enter ID,Password Library Operator

Enter ID,Password Administrator

Data Diagram
Level 2 DFD 3.Student Information Detail

Data Entry Operator Access User Information

Enter/Update/Delete User Information

Display Student Personal Information

Retrieve Student Info Student Personal Information

Validate/Process Student Information

Update/Delete Student Personal Information

Data Diagram
Level 2 DFD 4.Student Academic Information Data Entry Operator Access Academic Information

Marks Information Retrieve Student Marks Information Display Student Personal Information Retrieve Academic Information Enter/Update/Delete Academic Information

Subject Information

Update/Delete Subject Information Validate/Process Student Academic Information

Marks Information

Data Diagram
Level 2 DFD 5.Library Management Information

Data Entry Operator

Access User Information No. of Books in Stock Display Information

Books Issued Student Information

Issue/Return Process Update User Information

No. of days

ERD

RNo Year
Fathers name

Fnam e

Name
Mnam e

Salary

Lnam e

Cou rse

Faculty
Adv sor i

Student
Mother s name

Subject Code Rollno


G tes ener a

n lo Be s g

RNo

Is es su

Nam

Percentage

e Marks
Department

Library

Card1 Year Card2 Date Mont h

Dnam e

Data Dictionary

List Of Data Types : int char float

List Of Self Created Structures: personal : it groups variables for storing personal information of students i.e ( name , fathers name , mothers name ) academic : it groups variables for storing academic information of students i.e number of subjects , marks obtained and subject code. library : it groups library information of students including date, year, month. node : it includes groups variables to store general information about student roll number , course , year and objects of above structures. Books : it includes details about books and stores the roll number of students who issued the book. Roll : it groups roll number and card number. It is used to information when a book is issued. Staff : it groups details of staff members.

List Of Global Variables And Pointers: admin : type char[30] libpass : type char[30] head : type pointer to structure node list : type pointer to structure books teach : type pointer to structure staff

List Of Header Files And In-Built Function Used : conio.h This header file is included to provide various functions like clear screen etc. for use in this software. Functions used under this header file are :a) clrscr :- used for clearing the screen to default background color i.e

black. SYNTAX : void clrscr(void);


b) gotoxy :- it is used to position cursor in text window. Position is speci-

fying the x coordinate and y coordinate. SYNTAX :- void gotoxy(int x, int y);

c) getch :- it reads a single character directly from the keyboard, without

echoing it to the screen. SYNTAX : int getch(void);


d) kbhit :- it checks for currently available keystrokes. On success returns

non-zero integer else it returns 0. malloc.h This header file includes functions for allocating memory to variables. Functions used in this software under this header file are :a) calloc :- it is used to allocate memory to variable and set its value to 0.

It takes two arguments , one for number of copies and other for size of memory to be allocated. SYNTAX :- calloc() stdio.h It includes general functions for interacting with the user. It includes functions for taking inputs and printing outputs on user screen. Functions used in software under this header file are :a) printf :- it is used to print characters to default stream . it used to dis-

play information on the screen.

b) fprintf :- it is used to send formatted output to the stream passed as the

argument to it. On success return number of bytes output. On error return EOF (end of file). SYNTAX : int fprintf(FILE *stream, char *format [,argument.]);
c) scanf :- it is used to take inputs from the default stream.

SYNTAX : int scanf(const char *format[, address, ....]);


d) fscanf :- it is used to take inputs from the stream passed as a argument

to it. On success return the number of input fields successfully scanned. Returns EOF if an attempt is made to read end of file. SYNTAX : int fscanf( FILE *stream , char *format [,address,.]);
e) fflush :- It is used to flush the stream that is provided as an argument

to it. On success it returns 0 , and on erron return end of file. SYNTAX : int fflush(FILE *stream);
f) gotoxy :- it is to position cursor in text window at specified position.

SYNTAX : void gotoxy(int x,int y);


g) gets :- it collect a string of chararcters terminated by a new line from

the standard input stream stdin and puts it to s. on success returns argument string , on error return NULL. SYNTAX : char *gets(char *s);

h) fopen :- it opens a file and associate a stream with it. On success return

a pointer to the opened stream, on error return NULL. SYNTAX : FILE *fopen ( char *filename,char *mode);
i) fclose :- it closes the named dtream. It returns 0 on success and eof on

error. SYNTAX : int fclose(FILE *stream);


j) fgets :- it gets a string from a stream of length n. On success returns a

pointer to the string, on error returns NULL. SYNTAX : char *fgets( char *s , int n, FILE *stream);
k) fputs :- it outputs a string to a stream.on success return last character

written , on error returns EOF. SYNTAX : int fputs( char *s , FILE *stream);

graphics.h it includes graphics functions used to modifying how information is presented to the user. Functions used in software under this header file are :-

a) outtextxy :- it is used to print specified string in graphic mode at spec-

ified position. SYNTAX : void outtextxy(int x, int y, char *textstring);


b) line :- it is used to draw a line from 1 position to another

SYNTAX : void line(intx1,inty1,intx2,inty2);


c) cleardevice :- it erases the entire graphic screen and moves current

pointer position to (0,0). SYNTAX : void cleardevice(void);


d) settextstyle :- it sets the text font, direction in which text is displayed

and the size of characters. SYNTAX: void settextstyle(int font, int direction, int charsize);
e) setlinestyle :- it sets the current line style and width or pattern. If in-

valid values are passed then current line style remains unchanged. SYNTAX : void setlinestyle(int linestyle, unsigned upattern, int thickness);
f) setcolor :- it sets the current drawing color.

SYNTAX : void setcolor(int color);


g) setfillstyle :- it sets the fill pattern and color.

SYNTAX : void setfillstyle(int pattern, int color);

dos.h It includes time functions for providing delays, sound and other time related activities. Fuctions used in software under this header file are :a) delay :- it suspends execution for an interval of time given as a argu-

ment in milliseconds. SYNTAX : void delay (unsigned milliseconds); process.h It provides functions for exiting from the software. Functions used under this header file are :a) exit :- to exit from the software.

SYNTAX : string.h it provides functions for performing string manipulations. Functions used under this header file are :a) strcpy :- it is used to copy a string from 1 string variable to another.

SYNTAX :

b) strcmp :- it is used to compare two strings. It returns 0 if both strings

are equal. Returns negative number if string 1 is < string 2. Else returns 1. SYNTAX : int strcmp (char *s1,char *s2);
c) strcat :- it is used for concatenating two strings passed as an argument

to it. It return a pointer to the concatenated string. SYNTAX : char *strcat( char *dest,char *src);
d) strlen :- it is used to find the effective length of a string passed as an

argument to it. SYNTAX : size_t strlen(char *s);

List Of Self Made Functions :

newnode :- this function allocates memory of size of structure node and calls ngetdata function for asking details about new record created. It is called whenever a new student record is created. It returns a pointer to the new node created. DECLARATION : struct node * newnode( void );

newnode2 :- it allocates memory of size of structure books. Whenever a new book is added to the structure books this function is called. It return a pointer to structure book that is created. DECLARATION : struct books* newnode2 ( void );

newnode3 :- it allocates memory of size of structure roll. This function is called whenever a book is issued. It return a pointer pointing to the structure roll created. DECLARATION : struct roll * newnode3 ( void );

newnodestaff :- it allocates memory of size of structure staff. function is called whenever a new staff member is added to the database.

pgetdata :- this function creates form like display asking for details of personal information of the new student to be added to the existing or new records. It uses object ( pdata )of structure personal to access variables grouped under personal. It takes a pointer to structure node as an argument. This pointer tells the position in the linked list ( head ) where record is to be added. DECLARATION : void pgetdata ( struct node *temp );

agetdata :- this function creates form like display asking for academic details of the new student to be inserted. It uses object which is an array of structure academic. It takes two arguments one pointer to the structure node and second specifying the year of the student academic detail. DECLARATION : void agetdata ( struct node *temp , int j );

sgetdata :- this function creates the interface for takin values for the staff members.

ngetdata :- it asks for general information about students and calls functions pgetdata, agetdata . it takes single argument , which is a pointer to the structure node.

DECLARATION : void ngetdata ( struct node *temp );

insert :- it calls newnode and stores the address of new node created in a pointer to a structure. It then inserts this new node created into the linked list head at the end. LOGIC : it traverses to end of the linked list and the inserts the new node. It follows the normal algorithm for inserting a node at the end of a linked list. DECLARATION : void insert( void );

insert2 :- it is called when new book is to be entered ,it further calls newnode2. If name of the book is not in the database newnode2 is not called as its quantity is incremented. LOGIC : it follows algorithm for inserting a node at end of the linked list if the new book entered does not exist. If book exist traverses through the linked list to find the position of the record and increments the quantity. DECLARATION : void insert2 ( void );

insertstaff :- it is also called when new staff record is to be inserted , it further calls newnode staff.

disp2 :- it is used to display all books record stored in the database. DECLARATION : void disp2( void );

disp :- it is used to display all details of student record in detail. DECLARATION : void disp ( void );

smalldisp :- it is also used to display details of student in short. DECLARATION : void smalldisp( void );

gpass :- this function is used to get password from the user. It is called whenever there is an attempt to access official or important information. It takes three arguments for storing password entered and providing coordinates for displaying. DECLARATION : void gpass( char *password, int x, int y);

authenticate :- it is used to verify the password entered when an important information is requested. It takes two string argument one containing actual password and other password entered by the user. It returns 1 if there is a match , on mismatch return 0. DECLARATION : int authenticate ( char* pass, char *password);

save :- it is used to write all the books record stored in the linkedlist list to a file. DECLARATION : void save ( void );

save2 :-it is used to write all student records present in the linked list head to a file. DECLARATION : void save2 ( void );

load :- it is used to load all records saved in the file to the linkedlist list. DECLARATION : void load ( void );

load2 :- it is used to read all the student records from a file to the linked list head. DECLARATION : void load2( void );

ascii :- this functions returns the ascii value of the key pressed from the keyboard. DECLARATION : int ascii( void );

boundary :- this functions draws a borders in the color specified. DECLARATION : void boundary ( int color );

initial :- this function is used for providing a graphic view when called. DECLARATION : void initial ( int change);

clear :- it is used to clear the graphic view created by initial. DECLARATION : void clear( void );

startmenu :- this functions displays the starting interactive menu on the screen. DECLARATION : void startmenu ( int opt);

box :- it is used to draw a box in the centre of the screen. DECLARATION : void box( void );

result :- it asks for the roll number and displays the result of that student. DECLARATION : void result ( void );

issue :- this function is called when a student issues a book. It checks for all necessary details and issues the book. DECLARATION : void issue ( void );

ret :- this function is used whn a student returns a book. it checks for necessary details and then returns the book. DECLARATION : void ret ( void );

book :- it is a interactive menu for providing all necessary activities performed in a libraray. DECLARATION : void book ( void );

edit :- it is used for manipulating and editing existing records in the database. It takes roll number of student as an argument. DECLARATION : void edit ( int no);

del :- it is used to delete an existing student record. It checks for all necessary details and deletes the record. It takes roll number of the record to be deleted as an argument. DECLARATION : void del ( int no);

record :- it provides a sub menu for records. DECLARATION : void record ( void )

search :- it provides an interactive sub menu for performing search operations in the database. DECLARATION : void search( void );

start :- it contains background logic for providing interactive menu.

DECLARATION : void start ( void );

Program Logic
This software uses various algorithm like : Insertion in linked list : 1.

Program Code

#include<conio.h> #include<math.h> #include<malloc.h>

#include<stdio.h> #include<graphics.h> #include<dos.h> #include<process.h> #include<string.h>

char admin[30]; char libpass[30]; char teapass[30]; struct personal; struct academic; struct library; struct node; struct books; struct node* newnode(); struct books* newnode2(); struct roll* newnode3();

void pgetdata(struct node *); void agetdata(struct node *, int ); void lgetdata(struct node *); void ngetdata(struct node *); void insert(); void insert2(); void disp2(); void disp(struct node *); void smalldisp(); void gpass(char *,int,int,int); int authenticate(char *,char *); void save(); void load(); void save2(); void load2(); int ascii(); void boundary(int);

void initial(int); void clear(); void startmenu(int); void box(); void result(); void issue(); void ret(); void book(); void edit(int); void del(int); void record(); void search(); void start(); struct staff { char name[30]; char post[30];

char dept[30]; int salary; struct staff * next; }*teach; struct personal { char name[30]; char fname[30]; char mname[30]; }; struct academic { int no; int marks[10]; int sub_code[10]; float percent; };

struct library { int card[2]; int date[2]; int month[2]; int year[2]; }; struct node { int rollno; char course[30]; int year; struct personal pdata; struct academic adata[8]; struct library lib; struct node *next;

}*head; void sgetdata(struct staff *temp) { printf("\n\n\t\t NAME : "); gets(temp->name); printf("\n\t\t Post : "); gets(temp->post); printf("\n\t\t Department : "); gets(temp->dept); printf("\n\t\t Salary : "); scanf("%d",temp->salary); } void pgetdata(struct node *temp) { fflush(stdin); outtextxy(50,137,"NAME"); outtextxy(200,137,":");

gotoxy(28,10); gets(temp->pdata.name); outtextxy(50,168,"FATHERS NAME"); outtextxy(200,168,":"); gotoxy(28,12); gets(temp->pdata.fname); outtextxy(50,202,"MOTHERS NAME"); outtextxy(200,202,":"); gotoxy(28,14); gets(temp->pdata.mname); } void agetdata(struct node *temp , int j ) { int i; float sum; int ty=0,ty2=0; outtextxy(50,297,"ENTER NUMBER OF SUBJECTS (<10)");

outtextxy(400,297,":"); gotoxy(53,20); scanf("%d",&temp->adata[j].no); if(temp->adata[j].no>=10) temp->adata[j].no=9; i=0; clrscr(); cleardevice(); settextstyle(1,0,1); outtextxy(230,10,"DETAILS "); line(0,10,getmaxx(),10); line(0,35,getmaxx(),35); while(i<temp->adata[j].no) { outtextxy(50,73+ty,"SUBJECT CODE :: "); gotoxy(28,6+ty2); scanf("%d",&temp->adata[j].sub_code[i]);

outtextxy(320,73+ty,"MARKS ::"); gotoxy(53,6+ty2); scanf("%d",&temp->adata[j].marks[i]); sum+=temp->adata[j].marks[i]; i++; ty+=32; ty2+=2; } temp->adata[j].percent=sum/(temp->adata[j].no); outtextxy(170,390,"---- Record entered ----"); } void lgetdata(struct node *temp) { char ch='n'; int i=0; fflush(stdin); //printf("\n do you want to issue a book (y/n) ");

//scanf("%c",&ch); temp->lib.card[0]=0; temp->lib.card[1]=0; while(ch=='y') { printf("\n\n Enter date :: "); scanf("%d",&temp->lib.date[i]); printf("\n\n Enter month :: "); scanf("%d",&temp->lib.month[i]); printf("\n\n Enter year :: "); scanf("%d",&temp->lib.year[i]); temp->lib.card[i]=1; if(i==1) break; fflush(stdin); printf("\n do you want to issue more (y/n) "); scanf("%c",&ch);

i++; } }

void ngetdata(struct node *temp) { int i=0; char ch[30]; settextstyle(1,0,1); outtextxy(230,10,"DETAILS "); line(0,10,getmaxx(),10); line(0,35,getmaxx(),35); outtextxy(50,73,"ROLL NUMBER"); outtextxy(200,73,":"); gotoxy(28,6); scanf("%d",&(temp->rollno)); outtextxy(320,73,"CURRENT YEAR");

outtextxy(470,73,":"); gotoxy(61,6); scanf("%d",&(temp->year)); gotoxy(28,8); outtextxy(50,105,"COURSE"); outtextxy(200,105,":"); fflush(stdin); gets(temp->course); pgetdata(temp); while(i<temp->year) { agetdata(temp,i); i++; } lgetdata(temp); getch(); }

////// structure for books struct roll { int rno; int cno; struct roll *next; }; struct books { char book_name[30]; int qty; int issued; struct roll *r_no; struct books* next; }*list; ///// structures finished ....... ////////

void help() { clrscr(); cleardevice(); printf("\n\n\n\t * This software is case sensitive "); printf("\n\n\t * Restricted area can only be accessed by authorized personel "); printf("\n\n\t * There are useful shortcuts in this software : "); printf("\n\t - esc : is used to go back to previous menu "); printf("\n\t - p : is used to change passwords, if pressed at the starting menu "); printf("\n\n\t * When file is saved, if file previously exixted it will be overwritten "); printf("\n\n\t * Care should be taken while entering values "); getch(); } struct staff* newnodestaff() {

struct staff *ptr=NULL; ptr=(struct staff *)calloc(1,sizeof(struct staff)); if(ptr==NULL) { printf("MEMORY FAILURE"); getch(); } clrscr(); cleardevice(); sgetdata(ptr); ptr->next=NULL; return ptr; }

/// fuctions for list of node structure --- head struct node* newnode() {

struct node *ptr=NULL; ptr=(struct node *)calloc(1,sizeof(struct node)); if(ptr==NULL) { printf("MEMORY FAILURE"); getch(); } clrscr(); cleardevice(); ngetdata(ptr); ptr->next=NULL; return ptr; } void insert() { struct node *ptr=NULL; struct node *temp=head;

ptr=newnode(); if(head==NULL) { head=ptr; } else { ptr->next=NULL; temp=head; while(temp->next!=NULL) temp=temp->next; temp->next=ptr; } } void insertstaff() { struct staff *ptr=NULL;

struct staff *temp=teach; ptr=newnodestaff(); if(teach==NULL) { teach=ptr; } else { ptr->next=NULL; temp=teach; while(temp->next!=NULL) temp=temp->next; temp->next=ptr; } } ///// functions for list of book structure---- list

struct books* newnode2() { struct books *ptr=NULL; ptr=(struct books *)calloc(1,sizeof(struct books)); ptr->next=NULL; return ptr; } struct roll* newnode3() { struct roll* ptr=NULL; ptr=(struct roll *)calloc(1,sizeof(struct roll)); ptr->next=NULL; return ptr; } void insert2() { char b_name[30];

int qty; int found=0; struct books* temp=NULL; struct books* ptr=NULL; temp=list; fflush(stdin); printf("\n\n\t\t\t Enter book name :: "); gets(b_name); printf("\n\t\t\t Enter total qty :: "); scanf("%d",&qty); while(temp!=NULL) { if(strcmp(temp->book_name,b_name)==0) { temp->qty+=qty; found=1; break;

} else temp=temp->next; } if(found==0) { ptr=newnode2(); strcpy(ptr->book_name,b_name); ptr->qty=qty; ptr->issued=0; ptr->r_no=NULL; temp=list; if(temp==NULL) list=ptr; else { while(temp->next!=NULL)

temp=temp->next; temp->next=ptr; } }

void disp2() { struct books *temp=NULL; int y=80,i=0; int length; temp=list; while(1) { y=80; i=0;

clrscr(); cleardevice(); printf("\n\n\t ISSUED \n"); while(temp!=NULL ) { printf("\n %-23s%8d%10d%10d",tempNAME \t TOTAL AVAILABLE

>book_name,temp->qty,(temp->qty)-(temp->issued),temp->issued); temp=temp->next; i++; if(i==15) break; } length=i*16; line(25,30,25,63+length); line(230,30,230,63+length); line(300,30,300,63+length); line(400,30,400,63+length);

line(470,30,470,63+length); line(25,63,470,63); while(i>0) { line(25,y,470,y); y+=16; i--; } getch(); if(temp==NULL) break; } }

//////

display functions start from here ..... ///////

void disp(struct node *temp) {

int count=0; int i=0; clrscr(); cleardevice(); printf("\n\t\t Roll Number :: %20d",temp->rollno); printf("\n\t\t Name printf("\n\t\t Course printf("\n\t\t Year :: %20s",temp->pdata.name); :: %20s",temp->course); :: %20d",temp->year);

printf("\n\t\t Father's name :: %20s",temp->pdata.fname); printf("\n\t\t Mother's name :: %20s",temp->pdata.mname); for(i=0;i<2;i++) { if(temp->lib.card[i]==1) count++; } printf("\n\t\t Books issued :: %20d",count); i=0;

while(count>0) { printf("\n\t\t Issue date :: %12d/%2d/%4d ",temp>lib.date[i],temp->lib.month[i],temp->lib.year[i]); i++; count--; }

i=0; /* while(i<temp->year) { printf("\n\t\t Percentage :: %20f",temp->adata[i].percent); i++; } */ //getch(); //boundary(2); }

void smalldisp() { struct node *temp=head; int y=80,i=0; int length; while(1) { y=80; i=0; clrscr(); cleardevice(); printf("\n\n ROLL NUMBER \tNAME \t YEAR \n"); while(temp!=NULL ) { printf("\n %-8d%-25s%-25s%-5d",temp->rollno,tempCOURSE \t\t

>pdata.name,temp->course,temp->year); temp=temp->next;

i++; if(i==15) break; } length=i*16; line(25,30,25,63+length); line(130,30,130,63+length); line(330,30,330,63+length); line(520,30,520,63+length); line(570,30,570,63+length); line(25,63,570,63); while(i>0) { line(25,y,570,y); y+=16; i--; }

getch(); if(temp==NULL) break; } } /* void ask(int x, int y) { gotoxy(x,y); printf(" Enter Password :: ");

} */ void gpass(char *password,int x,int y,int z) { char ent[4]=""; char pass[30]=""; int t;

clrscr(); cleardevice(); gotoxy(x+5,y-4); printf(" RESTRICTED AREA "); gotoxy(x,y-2); if(z==0) printf("ENTER ADMINISTRATOTR PASSWORD "); if(z==1) printf("ENTER LIBRARIAN PASSWORD "); box(); gotoxy(x,y); while((int)(ent[0]=t=ascii())!=13) { if(t==8) { if(strlen(pass)>0) {

printf("\b \b"); pass[strlen(pass)-1]='\0'; } } else { strcat(pass,ent); printf("*"); } } strcpy(password,pass); } int authenticate(char *pass,char *password) { if(strcmp(pass,password)==0) return 1; else

return 0; } void save() { FILE *fout=fopen("bk.txt","w"); struct books *temp=NULL; struct roll *temp2=NULL; temp=list; while(temp!=NULL) { fprintf(fout,"%d\n%d\n",temp->qty,temp->issued); temp2=temp->r_no; while(temp2!=NULL) { if(temp2->rno==0) break; fprintf(fout,"%d\n%d\n",temp2->rno,temp2->cno);

temp2=temp2->next; } fprintf(fout,"%d\n",0); fprintf(fout,"%s\n",temp->book_name); temp=temp->next; } fclose(fout); save2(); } void load() { FILE *fout=fopen("bk.txt","r"); struct books *temp=NULL; struct books *ptr=NULL; struct roll *temp2=NULL; struct roll *ptr2=NULL; int rno,cno,len;

while(list!=NULL) { temp=list; while(list->r_no!=NULL) { temp2=list->r_no; list->r_no=list->r_no->next; free(temp2); } list=list->next; free(temp); } while(1) { temp=newnode2(); if(fscanf(fout,"%d%d",&temp->qty,&temp->issued)==EOF) break;

while(1) { fscanf(fout,"%d",&rno); if(rno==0) break; fscanf(fout,"%d",&cno); temp2=newnode3(); temp2->rno=rno; temp2->cno=cno; if(temp->r_no==NULL) temp->r_no=temp2; else { ptr2=temp->r_no; while(ptr2->next!=NULL) ptr2=ptr2->next; ptr2->next=temp2;

} }

fscanf(fout,"%d",&rno); fgets(temp->book_name,30,fout); len=strlen(temp->book_name); temp->book_name[len-1]='\0'; if(list==NULL) list=temp; else { ptr=list; while(ptr->next!=NULL) ptr=ptr->next; ptr->next=temp; } }

fclose(fout); free(temp); load2(); } void save2() { struct node *temp=NULL; FILE *fout=fopen("moh.txt","w"); int i=0,j=0; temp=head; while(temp!=NULL) { fprintf(fout,"%d\n%d\n",temp->rollno,temp->year); for(i=0;i<2;i++) fprintf(fout,"%d\n%d\n%d\n%d\n",temp->lib.card[i],temp>lib.date[i],temp->lib.month[i],temp->lib.year[i]); for(i=0;i<temp->year;i++) {

fprintf(fout,"%d\n",temp->adata[i].no); for(j=0;j<temp->adata[i].no;j++) fprintf(fout,"%d\n%d\n",temp>adata[i].marks[j],temp->adata[i].sub_code[j]); } fprintf(fout,"%s\n",temp->course); fprintf(fout,"%s\n%s\n%s\n",temp->pdata.name,temp->pdata.fname,temp->pdata.mname); temp=temp->next; } fclose(fout); } void load2() { struct node *temp=NULL; struct node *ptr=NULL; FILE *fout=fopen("moh.txt","r"); int i=0,j=0;

int len; while(head!=NULL) { temp=head; head=head->next; free(temp); } temp=head=NULL; while(1) { temp=(struct node*)calloc(1,sizeof(struct node)); if(fscanf(fout,"%d%d",&temp->rollno,&temp->year)==EOF) break; for(i=0;i<2;i++) fscanf(fout,"%d%d%d%d",&temp->lib.card[i],&temp->lib.date[i],&temp->lib.month[i],&temp->lib.year[i]); for(i=0;i<8;i++) {

fscanf(fout,"%d",&temp->adata[i].no); for(j=0;j<temp->adata[i].no;j++) fscanf(fout,"%d%d",&temp>adata[i].marks[j],&temp->adata[i].sub_code[j]); } fgets(temp->course,30,fout); len=strlen(temp->course); temp->course[len-1]='\0'; fgets(temp->pdata.name,30,fout); len=strlen(temp->pdata.name); temp->pdata.name[len-1]='\0'; fgets(temp->pdata.fname,30,fout); len=strlen(temp->pdata.fname); temp->pdata.fname[len-1]='\0'; fgets(temp->pdata.mname,30,fout); len=strlen(temp->pdata.mname); temp->pdata.mname[len-1]='\0'; if(head==NULL)

{ head=temp; } else { ptr=head; while(ptr->next!=NULL) ptr=ptr->next; ptr->next=temp; } } free(temp); } int ascii() { int asc; asc=getch();

if(asc==0) return getch(); return asc; } void boundary(int color) { int x=getmaxx(); int y=getmaxy(); setcolor(color); setlinestyle(SOLID_LINE,1,3); line(0,0,x,0); line(0,0,0,y); line(x,0,x,y); line(0,y,x,y); } void initial(int change) {

int inc=30; int x1=3,x2=30; setlinestyle(SOLID_LINE,1,3); setcolor(0); line(2,30,getmaxx()-2,30); setcolor(2); if(change==1) inc=0; while(x2+inc<getmaxx()) { line(x1+inc,30,x2+inc,30); x1+=60; x2+=60; } } void clear() {

int x1=301,y1=211,x2=338,y2=268; setcolor(2); setfillstyle(SOLID_FILL,0); while(x1>=1) { bar3d(x1,y1,x2,y2,0,0); x1=x1-10; y1=y1-7; x2=x2+10; y2=y2+7; delay(20);

} //boundary(2); } void startmenu(int opt) {

textcolor(BLACK); if(opt==1) { printf("\n\n\n\n\n\n\n\t\t\t\t%c Enter Records %c",17,16); printf("\n\t\t\t\t Display Records "); printf("\n\t\t\t\t Search Records "); printf("\n\t\t\t\t Library "); printf("\n\t\t\t\t Result "); printf("\n\t\t\t\t Save "); printf("\n\t\t\t\t Load "); printf("\n\t\t\t\t Help "); printf("\n\t\t\t\t Exit ");

} else if(opt==2) {

printf("\n\n\n\n\n\n\n\t\t\t\t Enter Records "); printf("\n\t\t\t\t%c Display Records %c",17,16); printf("\n\t\t\t\t Search Records "); printf("\n\t\t\t\t Library "); printf("\n\t\t\t\t Result "); printf("\n\t\t\t\t Save "); printf("\n\t\t\t\t Load "); printf("\n\t\t\t\t Help "); printf("\n\t\t\t\t Exit ");

} else if(opt==3) { printf("\n\n\n\n\n\n\n\t\t\t\t Enter Records "); printf("\n\t\t\t\t Display Records "); printf("\n\t\t\t\t%c Search Records %c",17,16); printf("\n\t\t\t\t Library ");

printf("\n\t\t\t\t Result "); printf("\n\t\t\t\t Save "); printf("\n\t\t\t\t Load "); printf("\n\t\t\t\t Help "); printf("\n\t\t\t\t Exit ");

} else if(opt==4) { printf("\n\n\n\n\n\n\n\t\t\t\t Enter Records "); printf("\n\t\t\t\t Display Records "); printf("\n\t\t\t\t Search Records "); printf("\n\t\t\t\t%c Library %c",17,16); printf("\n\t\t\t\t Result "); printf("\n\t\t\t\t Save "); printf("\n\t\t\t\t Load "); printf("\n\t\t\t\t Help ");

printf("\n\t\t\t\t Exit ");

} else if(opt==5) { printf("\n\n\n\n\n\n\n\t\t\t\t Enter Records "); printf("\n\t\t\t\t Display Records "); printf("\n\t\t\t\t Search Records "); printf("\n\t\t\t\t Library "); printf("\n\t\t\t\t%c Result %c",17,16); printf("\n\t\t\t\t Save "); printf("\n\t\t\t\t Load "); printf("\n\t\t\t\t Help "); printf("\n\t\t\t\t Exit ");

} else if(opt==6)

{ printf("\n\n\n\n\n\n\n\t\t\t\t Enter Records "); printf("\n\t\t\t\t Display Records "); printf("\n\t\t\t\t Search Records "); printf("\n\t\t\t\t Library "); printf("\n\t\t\t\t Result "); printf("\n\t\t\t\t%c Save %c",17,16); printf("\n\t\t\t\t Load "); printf("\n\t\t\t\t Help "); printf("\n\t\t\t\t Exit ");

} else if(opt==7) { printf("\n\n\n\n\n\n\n\t\t\t\t Enter Records "); printf("\n\t\t\t\t Display Records "); printf("\n\t\t\t\t Search Records ");

printf("\n\t\t\t\t Library "); printf("\n\t\t\t\t Result "); printf("\n\t\t\t\t Save "); printf("\n\t\t\t\t%c Load %c",17,16); printf("\n\t\t\t\t Help "); printf("\n\t\t\t\t Exit ");

} else if(opt==8) { printf("\n\n\n\n\n\n\n\t\t\t\t Enter Records "); printf("\n\t\t\t\t Display Records "); printf("\n\t\t\t\t Search Records "); printf("\n\t\t\t\t Library "); printf("\n\t\t\t\t Result "); printf("\n\t\t\t\t Save "); printf("\n\t\t\t\t Load ");

printf("\n\t\t\t\t%c Help %c",17,16); printf("\n\t\t\t\t Exit ");

} else { printf("\n\n\n\n\n\n\n\t\t\t\t Enter Records "); printf("\n\t\t\t\t Display Records "); printf("\n\t\t\t\t Search Records "); printf("\n\t\t\t\t Library "); printf("\n\t\t\t\t Result "); printf("\n\t\t\t\t Save "); printf("\n\t\t\t\t Load "); printf("\n\t\t\t\t Help "); printf("\n\t\t\t\t%c Exit %c",17,16); } }

void box() { line(150,205,470,205); line(470,205,470,225); line(470,225,150,225); line(150,225,150,205); } void result() { struct node* temp=NULL; int r_no; int i=0,j=0; cleardevice(); setcolor(GREEN); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t Enter your roll number ::"); box(); scanf("%d",&r_no);

temp=head; while(temp!=NULL) { if(temp->rollno==r_no) break; else temp=temp->next; } if(temp==NULL) printf("\n\n\n\n\n Enter valid roll number ... "); else { clrscr(); cleardevice(); printf("\n\t\t\t Name :: %20s",temp->pdata.name);

printf("\n\t\t\t Roll Number :: %20d",temp->rollno); line(1,70,getmaxx(),70);

while(i<temp->year) { j=0; printf("\n\n\n Result Year %d ",i+1); printf("\n\n Subject code \t\t Marks"); while(j<temp->adata[i].no) { printf("\n %7d \t %13d ",temp>adata[i].sub_code[j],temp->adata[i].marks[j]); j++; } i++; getch(); }

} getch(); }

void issue() { int rno,i=0; struct node *ptr=NULL; struct books *temp2=NULL; struct roll *ptr3=NULL; struct roll *temp3=NULL; char b_name[30]; printf("\n\n\n\t\t\t Enter your roll no :: "); scanf("%d",&rno); ptr=head; while(ptr!=NULL) { if(ptr->rollno==rno) break; else ptr=ptr->next;

} if(ptr==NULL) printf("\n\n\n\t\t\t Enter valid roll number "); else {

while(ptr->lib.card[i]!=0) { i++; if(i==2) break; } if(i==2) printf("\n\n\n\t\t\t All cards used , book cannot be issued "); else { temp2=list;

disp2(); fflush(stdin); printf("\n\n Enter Book name "); gets(b_name); while(temp2!=NULL) { if(strcmp(temp2->book_name,b_name)==0) break; else temp2=temp2->next; } if(temp2==NULL) { printf("\n\n Book not found ");

} else if((temp2->qty-temp2->issued)<1)

printf("\n\n Book already issued no more book available"); else { printf("\n\n Enter date :: "); scanf("%d",&ptr->lib.date[i]); printf("\n\n Enter month :: "); scanf("%d",&ptr->lib.month[i]); printf("\n\n Enter year :: "); scanf("%d",&ptr->lib.year[i]); ptr->lib.card[i]=1; temp2->issued=temp2->issued+1; temp3=newnode3(); temp3->rno=rno; temp3->cno=i; temp3->next=NULL; if(temp2->r_no==NULL) temp2->r_no=temp3;

else { ptr3=temp2->r_no; while(ptr3->next!=NULL) ptr3=ptr3->next; ptr3->next=temp3; } printf("\n\n\n\t\t\t Book Issued"); } } } getch(); } void ret() { int rno,i; struct node *ptr=NULL;

struct books *temp2=NULL; struct roll *ptr3=NULL; struct roll *temp3=NULL; char b_name[30]; printf("\n\n\n\t\t\t Enter your roll no :: "); scanf("%d",&rno); ptr=head; while(ptr!=NULL) { if(ptr->rollno==rno) break; else ptr=ptr->next; } if(ptr==NULL) printf("\n\n\n\t\t\t Enter valid roll number "); else

{ /* if(ptr->lib.card[0]==1) printf("\n\n\t\t CARD 1 :: %2d/%2d/%4d ",ptr>lib.date[0],ptr->lib.month[0],ptr->lib.year[0]); else printf("\n\n\t\t CARD 1 :: No book issued "); if(ptr->lib.card[1]==1) printf("\n\n\t\t CARD 2 :: %2d/%2d/%4d ",ptr>lib.date[1],ptr->lib.month[1],ptr->lib.year[1]); else printf("\n\n\t\t CARD 2 :: No book issued "); */ if(ptr->lib.card[0]==1 | ptr->lib.card[1]==1) { fflush(stdin); temp2=list; printf("\n\n\t\t Enter book to be returned ::");

gets(b_name); while(temp2!=NULL) { if(strcmp(temp2->book_name,b_name)==0) break; else temp2=temp2->next; } if(temp2!=NULL) { //printf("\n\n Enter card number :: "); //scanf("%d",&i); //ptr->lib.card[i-1]=0; ptr3=temp2->r_no; while(ptr3!=NULL) { if(ptr3->rno==rno)

break; temp3=ptr3; ptr3=ptr3->next; } if(ptr3!=NULL) { if(ptr3==temp3) temp2->r_no=ptr3->next; else if(ptr3->next==NULL) temp3->next=NULL; else temp3->next=ptr3->next; ptr->lib.card[ptr3->cno]=0; temp2->issued=temp2->issued-1; printf("Book returned "); free(ptr3); }

else printf("\n\n No such book issued under this roll no "); } else printf("\n Book is not of this library "); }

} getch(); }

void book() { int change=1,opt=1; int ch; char temppass[30]; while(1)

{ clrscr(); cleardevice(); outtextxy(275,0," LIBRARY "); if(opt==1) { printf("\n\n\n\n\n\n\n\t\t\t\t%c Add Book %c",17,16); printf("\n\t\t\t\t Display books "); printf("\n\t\t\t\t Issue Book "); printf("\n\t\t\t\t Return Book "); } if(opt==2) { printf("\n\n\n\n\n\n\n\t\t\t\t Add Book "); printf("\n\t\t\t\t%c Display books %c",17,16); printf("\n\t\t\t\t Issue Book "); printf("\n\t\t\t\t Return Book ");

} if(opt==3) { printf("\n\n\n\n\n\n\n\t\t\t\t Add Book "); printf("\n\t\t\t\t Display books "); printf("\n\t\t\t\t%c Issue Book %c",17,16); printf("\n\t\t\t\t Return Book "); } if(opt==4) { printf("\n\n\n\n\n\n\n\t\t\t\t Add Book "); printf("\n\t\t\t\t Display books "); printf("\n\t\t\t\t Issue Book "); printf("\n\t\t\t\t%c Return Book %c",17,16); } boundary(2); while(!kbhit())

initial(change); if(change>0) change--; else change++; delay(100); } ch=ascii(); if(ch==72) { if(opt==1) opt=4; else opt--; }

if(ch==80) { if(opt==4) opt=1; else opt++; } if(ch==27) break; if(ch==13) { if(opt==1) { gpass(temppass,20,14,1); if(authenticate(libpass,temppass)==0) break; insert2();

} else if(opt==2) disp2(); else if(opt==3) { //if(authnticate(libpass,gdata)) gpass(temppass,20,14,1); if(authenticate(libpass,temppass)==0) break; issue(); } else { //// gpass(temppass,20,14,1); if(authenticate(libpass,temppass)==0) break;

ret(); } break; } } }

void edit(int no) { struct node *ptr=NULL; char ch='n'; int num,ty=32; int y=2; char string[30]; ptr=head; //getch(); clrscr();

cleardevice(); while(ptr!=NULL) { if(ptr->rollno==no) break; ptr=ptr->next; } if(ptr!=NULL) { fflush(stdin); outtextxy(20,20,"Change ROLL No. , COURSE or YEAR (y/n) "); ch=getch(); if(ch=='y') { fflush(stdin); outtextxy(16,73,"Previous roll no : "); gotoxy(25,6);

printf("%d",ptr->rollno); outtextxy(280,73,"\n New roll no :"); gotoxy(55,6); scanf("%d",&ptr->rollno); outtextxy(16,73+ty,"Previous year :"); gotoxy(25,6+y); printf("%d",ptr->year); outtextxy(280,73+ty,"\n Enter year :"); gotoxy(55,6+y); scanf("%d",ptr->year); ty+=17; y+=2; outtextxy(16,73+ty,"Previous course : "); gotoxy(25,6+y); printf("%s ",ptr->course); outtextxy(280,73+ty,"Enter course : "); gotoxy(55,6+y);

gets(ptr->course); gets(ptr->course); } printf("\n Do you want to change personal information (y/n) ::"); ch=getche(); if(ch=='y') { fflush(stdin); printf("\n\n Name :: %s",ptr->pdata.name); printf("\n Enter name :: "); gets(ptr->pdata.name); printf("\n\n Fathers Name :: %s",ptr->pdata.fname); printf("\n Enter Fathers name :: "); gets(ptr->pdata.fname); printf("\n\n Mothers Name :: %s",ptr->pdata.mname); printf("\n Enter Mothers name :: "); gets(ptr->pdata.mname);

} } else printf("\n\n Record not found "); } void del(int no) { struct node *ptr=NULL; struct node *temp=NULL; temp=head; ptr=temp; while(temp!=NULL) { if(temp->rollno==no) { if(temp->lib.card[0]!=0 || temp->lib.card[1]!=0) {

printf("Clear library account "); getch(); return; } break; } ptr=temp; temp=temp->next; } if(temp==NULL) { printf("\n\n No such Record found "); getch(); } else { if(ptr==temp)

head=head->next; else if(temp->next==NULL) ptr->next=NULL; else ptr->next=temp->next; free(temp); printf("\n\n Record deleted sucessfully "); } } void record() { int change=1,opt=1; int ch,no; char temppass[30]; while(1) { clrscr();

cleardevice(); outtextxy(275,0," RECORDS "); if(opt==1) { printf("\n\n\n\n\n\n\n\t\t\t\t%c Display %c",17,16); printf("\n\t\t\t\t Add "); printf("\n\t\t\t\t Edit "); printf("\n\t\t\t\t Delete ");

} if(opt==2) { printf("\n\n\n\n\n\n\n\t\t\t\t Display "); printf("\n\t\t\t\t%c Add %c",17,16); printf("\n\t\t\t\t Edit "); printf("\n\t\t\t\t Delete "); }

if(opt==3) { printf("\n\n\n\n\n\n\n\t\t\t\t Display "); printf("\n\t\t\t\t Add "); printf("\n\t\t\t\t%c Edit %c",17,16); printf("\n\t\t\t\t Delete "); } if(opt==4) { printf("\n\n\n\n\n\n\n\t\t\t\t Display "); printf("\n\t\t\t\t Add "); printf("\n\t\t\t\t Edit "); printf("\n\t\t\t\t%c Delete %c",17,16); } boundary(2); while(!kbhit()) {

initial(change); if(change>0) change--; else change++; delay(100); } ch=ascii(); if(ch==72) { if(opt==1) opt=4; else opt--; } if(ch==80)

{ if(opt==4) opt=1; else opt++; } if(ch==27) break; if(ch==13) { //temp=head; fflush(stdin); if(opt==1) { clrscr(); cleardevice(); smalldisp();

} if(opt==2) { //// gpass(temppass,20,14,0); if(authenticate(admin,temppass)==1) insert(); else break; } if(opt==3) { //// gpass(temppass,20,14,0); if(authenticate(admin,temppass)==0) break; smalldisp();

clrscr(); cleardevice(); printf("\n\n Enter Roll number of the record to be edited :: "); scanf("%d",&no); edit(no); } if(opt==4) { //// gpass(temppass,20,14,0); if(authenticate(admin,temppass)==0) break; smalldisp(); clrscr(); cleardevice(); printf("\n\n Enter Roll number of the record to be deleted :: ");

scanf("%d",&no); del(no); } getch(); break; } } }

void search() { int change=1,opt=1; int ch; int rno; char string[30]; struct node *temp=NULL; while(1)

{ clrscr(); cleardevice(); outtextxy(275,0," SEARCH "); if(opt==1) { printf("\n\n\n\n\n\n\n\t\t\t\t%c By Roll number %c",17,16); printf("\n\t\t\t\t By Name "); printf("\n\t\t\t\t By Course "); } if(opt==2) { printf("\n\n\n\n\n\n\n\t\t\t\t By Roll number "); printf("\n\t\t\t\t%c By Name %c",17,16); printf("\n\t\t\t\t By Course "); } if(opt==3)

{ printf("\n\n\n\n\n\n\n\t\t\t\t By Roll number "); printf("\n\t\t\t\t By Name "); printf("\n\t\t\t\t%c By Course %c",17,16); } boundary(2); while(!kbhit()) {

initial(change); if(change>0) change--; else change++; delay(100); } ch=ascii();

if(ch==72) { if(opt==1) opt=3; else opt--; } if(ch==80) { if(opt==3) opt=1; else opt++; } if(ch==27) break; if(ch==13)

{ temp=head; fflush(stdin); if(opt==1) { clrscr(); cleardevice(); printf("\n\n\n\n\n\n\n\n\n\n\n\n\n\t\t Enter roll number ::"); box(); scanf("%d",&rno); while(temp!=NULL) { if(temp->rollno==rno) { cleardevice(); disp(temp); getch();

} temp=temp->next; } printf("\n\n\n There are no more records "); } if(opt==2) { printf("\n\n\n\t\t\t Enter Name :: "); gets(string); while(temp!=NULL) { if(strcmp(temp->pdata.name,string)==0) { cleardevice(); disp(temp); getch(); }

temp=temp->next; } printf("\n\n\n There are no more records "); } if(opt==3) { printf("\n\n\n\t\t\t Enter Course :: "); gets(string); while(temp!=NULL) { if(strcmp(temp->course,string)==0) { cleardevice(); disp(temp); getch(); } temp=temp->next;

} printf("\n\n\n There are no more records "); } getch(); break; } } } void start() { int change=1; int opt=1; int ch,tint; struct node *temp=NULL; settextstyle(1,0,3); setcolor(3); while(1)

{ clrscr(); cleardevice(); outtextxy(275,0," MENU "); startmenu(opt); boundary(2); while(!kbhit()) { initial(change); if(change>0) change--; else change++; delay(100); } ch=ascii(); if(ch==72)

{ if(opt==1) opt=9; else opt--; } if(ch==80) { if(opt==9) opt=1; else opt++; } if(ch==13) { clear(); clrscr();

if(opt==1) { cleardevice(); record(); } else if(opt==2) { cleardevice(); temp=head; while(temp!=NULL) { disp(temp); tint=ascii(); if(tint==27) break; temp=temp->next; }

} else if(opt==3) search(); else if(opt==4) book(); else if(opt==5) result(); else if(opt==6) save(); else if(opt==7) load(); else if(opt==8) help(); else exit(0); } }

} void main() { int gdriver = DETECT, gmode, errorcode; char t[30]; FILE *file; initgraph(&gdriver, &gmode, "c:\\tc\\"); file=fopen("ppp1","r"); fread(&admin,sizeof(admin),1,file); fread(&libpass,sizeof(libpass),1,file); printf("\n %s %s",admin,libpass); getch(); fclose(file); start(); getch(); }

Screen Layout Main Screen

Search Menu

Library Menu

Help Screen

Password Interface

Student Database

Report Layout

Use Case Diagram

Login

result details Marks Entry Clerk Administrator

user accounts

Subject info

generate reports

student info Library operator Data Entry Operator books Info

Staff info Report Generator

Test cases
A test case has components that describes an input, action or event and an expected response, to determine if a feature of an application is working correctly.

There are levels in which each test case will fall in order to avoid duplication efforts.

Level 1: In this level you will write the basic test cases from the available
specification and user documentation.

Level 2: This is the practical stage in which writing test cases depend on actual
functional and system flow of the application.

Level 3: This is the stage in which you will group some test cases and write a test
procedure. Test procedure is nothing but a group of small test cases maximum of 10.

Level 4: Automation of the project. This will minimize human interaction with system
and thus QA can focus on current updated functionalities to test rather than remaining busy with regression testing.

Need to write test cases


The basic objective of writing test cases is to validate the testing coverage of the application. So writing test cases brings some sort of standardization and minimizes the ad-hoc approach in testing.

BIBLIOGRAPHY

Introduction to algorithms (Corman) Understanding pointers in c (Yashwant Kanetkar)

Vous aimerez peut-être aussi