Computer science class 12 project on Super Market BillingHarsh Kumar
Certificate
--Declaration
--Acknowledgement
--Hardware and software requirements
--Classes and function used
--Header files used
--Files generated
--Working description
--Coding
--Output screen
--Bibliography
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM),CBSE Class 12 computer project,Class XII computer project, A project work on Hotel management system in C++,Class 12 C++ Projects, Projects in C++ for Class XII CBSE, C++ Class XII project
Library Management Project (computer science) class 12RithuJ
This project descibes the Library management system.This includes the code, its output and the applications. This software has main menu, admin menu that has provision to create student & book record, display student & book record, modify student & book record, delete student & book record .
Rithu
AECS Kudankulam
Computer science class 12 project on Super Market BillingHarsh Kumar
Certificate
--Declaration
--Acknowledgement
--Hardware and software requirements
--Classes and function used
--Header files used
--Files generated
--Working description
--Coding
--Output screen
--Bibliography
Computer Investgatort Project (HOTEL MANAGEMENT SYSTEM),CBSE Class 12 computer project,Class XII computer project, A project work on Hotel management system in C++,Class 12 C++ Projects, Projects in C++ for Class XII CBSE, C++ Class XII project
Library Management Project (computer science) class 12RithuJ
This project descibes the Library management system.This includes the code, its output and the applications. This software has main menu, admin menu that has provision to create student & book record, display student & book record, modify student & book record, delete student & book record .
Rithu
AECS Kudankulam
Python Project book shop system.This project BOOKSHOP SYSTEM includes some facilities for the retail book shop to maintain records of the books and also search, display, modification, delete etc the books available. This software searches the books data which is store in the record.
Development of an interactive car sale system which lets a user to find a car and its details is the main objective of this project. The administrators can access, enter, modify and delete the details of every car. Administrators are responsible of maintaining the details of vehicles like the Manufacturer information,
This project is based on Library Management. Python and MySQL are the programming platforms which are used in making of this project.
Subject-Informatics Practices
Class-11/12
Cosmetics Shop Management System is a complete solution for managing a Shop, in other words, an enhanced tool that assists in organizing the day-to-day activities of a Shop. There is the need of an application for efficient management and handling customer orders. This Cosmetics Shop Management System keeps every record Shop and reducing paperwork
class 12th computer science project Employee Management System In PythonAbhishekKumarMorla
This is the employment management system designed in python without using any interface through sql it does not have sequence structured query or sql connectivity but perhaps it has file handling concept.
How To Use It:
just replace the txt file and location on the code
also always use the id of employment as shown below:
01
because in the code it search for the index 0,1 therefore it have only two digits employee names
you can make it to 3 or 4 just by replacing the code
we have already mentioned in the code part..
Download link ( copy link to download )
https://drive.google.com/file/d/1TOz6arCdt4Nhfm_2emBzQCmgGSTCVQHy/view?usp=sharing
to add this to net beans just do this
1) open netbeans
2) on the top left, click file.
3) then click import project, there select from zip
4) use my file which u downloaded
5) import and thats it
Enjoy Using my Project as a reference for your own Project.
I hope that this will help you to understand what to do in your own project.
Happy Coding Nerds!!
git hub link to download it to ur system
https://github.com/Yosh1kageK1ra/12th-Class-Project-CBSE.git
In this presentation, Amit explains querying with MongoDB in detail including Querying on Embedded Documents, Geospatial indexing and Querying etc.
The tutorial includes a recap of MongoDB, the wrapped queries, queries which are using modifiers, Upsert (saving/ updating queries), updating multiple documents at once, etc. Moreover, it gives a brief explanation about specifying which keys to return, the AND/OR queries, querying on embedded documents, cursors and Geospatial indexing. The tutorial begins with a section about MongoDB which includes steps to install and start MongoDB, to show and select Database, to drop collection and database, steps to insert a document and get up to 20 matching documents. Furthermore, it also includes steps to store and use Javascript functions on the server side.
The next section after the MongoDB section is about wrapped queries and queries using modifiers which includes the types of wrapped queries which are used like LikeQuery, SortQuery, LimitQuery, SkipQuery. It also includes the types of queries using modifiers like NotEqualModifier, Greater/Lesser modifier, Increment Modifier, Set Modifier, Unset Modifier, Push Modifier etc. Then comes the section about Upsert (Save or update). There are steps mentioned for saving or updating queries in this section.
At the same time, there are steps to update multiple documents altogether. The next section which is called “specifying which keys to return” talks about ways to specify the keys the user wants. After this section comes OR/AND query. It informs us about the general steps to do an OR query. Also, it includes the general steps to do an AND query. After this section comes another section called “querying on embedded document” which tells the user about ways of querying for an embedded document.
One of the important sections of this tutorial is about cursors, uses of a cursor and also methods to chain additional options onto a query before it is performed. Following is a section about indexing which talks about indexing as a term and how indexing helps in improving the query’s speed. At the end is a section which gives a brief explanation on geospatial indexing which is another type of query that became common with the emergence of mobile devices. Also, it includes the ways geospatial queries can be performed.
Python Project book shop system.This project BOOKSHOP SYSTEM includes some facilities for the retail book shop to maintain records of the books and also search, display, modification, delete etc the books available. This software searches the books data which is store in the record.
Development of an interactive car sale system which lets a user to find a car and its details is the main objective of this project. The administrators can access, enter, modify and delete the details of every car. Administrators are responsible of maintaining the details of vehicles like the Manufacturer information,
This project is based on Library Management. Python and MySQL are the programming platforms which are used in making of this project.
Subject-Informatics Practices
Class-11/12
Cosmetics Shop Management System is a complete solution for managing a Shop, in other words, an enhanced tool that assists in organizing the day-to-day activities of a Shop. There is the need of an application for efficient management and handling customer orders. This Cosmetics Shop Management System keeps every record Shop and reducing paperwork
class 12th computer science project Employee Management System In PythonAbhishekKumarMorla
This is the employment management system designed in python without using any interface through sql it does not have sequence structured query or sql connectivity but perhaps it has file handling concept.
How To Use It:
just replace the txt file and location on the code
also always use the id of employment as shown below:
01
because in the code it search for the index 0,1 therefore it have only two digits employee names
you can make it to 3 or 4 just by replacing the code
we have already mentioned in the code part..
Download link ( copy link to download )
https://drive.google.com/file/d/1TOz6arCdt4Nhfm_2emBzQCmgGSTCVQHy/view?usp=sharing
to add this to net beans just do this
1) open netbeans
2) on the top left, click file.
3) then click import project, there select from zip
4) use my file which u downloaded
5) import and thats it
Enjoy Using my Project as a reference for your own Project.
I hope that this will help you to understand what to do in your own project.
Happy Coding Nerds!!
git hub link to download it to ur system
https://github.com/Yosh1kageK1ra/12th-Class-Project-CBSE.git
In this presentation, Amit explains querying with MongoDB in detail including Querying on Embedded Documents, Geospatial indexing and Querying etc.
The tutorial includes a recap of MongoDB, the wrapped queries, queries which are using modifiers, Upsert (saving/ updating queries), updating multiple documents at once, etc. Moreover, it gives a brief explanation about specifying which keys to return, the AND/OR queries, querying on embedded documents, cursors and Geospatial indexing. The tutorial begins with a section about MongoDB which includes steps to install and start MongoDB, to show and select Database, to drop collection and database, steps to insert a document and get up to 20 matching documents. Furthermore, it also includes steps to store and use Javascript functions on the server side.
The next section after the MongoDB section is about wrapped queries and queries using modifiers which includes the types of wrapped queries which are used like LikeQuery, SortQuery, LimitQuery, SkipQuery. It also includes the types of queries using modifiers like NotEqualModifier, Greater/Lesser modifier, Increment Modifier, Set Modifier, Unset Modifier, Push Modifier etc. Then comes the section about Upsert (Save or update). There are steps mentioned for saving or updating queries in this section.
At the same time, there are steps to update multiple documents altogether. The next section which is called “specifying which keys to return” talks about ways to specify the keys the user wants. After this section comes OR/AND query. It informs us about the general steps to do an OR query. Also, it includes the general steps to do an AND query. After this section comes another section called “querying on embedded document” which tells the user about ways of querying for an embedded document.
One of the important sections of this tutorial is about cursors, uses of a cursor and also methods to chain additional options onto a query before it is performed. Following is a section about indexing which talks about indexing as a term and how indexing helps in improving the query’s speed. At the end is a section which gives a brief explanation on geospatial indexing which is another type of query that became common with the emergence of mobile devices. Also, it includes the ways geospatial queries can be performed.
It isn't mine but i sure hope it helps others.It's a Mini Project on a Food Automaton Restaurant type.you know Enter food type stuff. It's in C++ ,so it's an easy one .You can understand it on your own
Presented at ACCU Oxford (14th September 2015)
Functional C++? As opposed to what — dysfunctional? Well, kind of, yeah. Sure, in C++ the principal unit of composition is called a function, but that doesn't mean it's a functional language. And the idea of restricting mutability of state gets a nod with const, but it's a nod not a hug. And the STL shows influences of functional programming, although it falls short of being compositional. And, yes, sure, C++11 has lambdas, but then again, these days, who doesn't? Lambda calculus was invented in the 1930s.
This talk looks at how to express functional programming ideas in (post)modern C++ in a way that can be considered idiomatic to C++, rather than trying to use the power of overloading and meta-programming to pretend C++ is Haskell or Lisp. In short, immutability beyond const and into shared and persistent data structures, concurrency beyond threading and locks, and thinking about functions as transformations and units of composition rather than actions.
in this assignment you are asked to write a simple driver program an.pdfmichardsonkhaicarr37
in this assignment you are asked to write a simple driver program and set of functions (maybein
a library) that can be performed on a binary search tree.
Your program should allow user to insert/delete integer values into the binary search tree along
with several other operations on the binary search tree. You can use the code given in slides. But
this time your key will be int! Specifically, your program will ask user to enter a command and
related parameters (if any) in a loop, and then perform the given commands. Here is the list of
commands that your program must implement:
* insert
*find\'
*delete
*list inorder
*list preorder
*list postorder
*list levelorder
* max
* min
* height
*count
* sum
*quit
As always, make sure you release (free) the dynamically allocated memories if you allocate any
memory in your programs. So, before submitting your program, run it with valgrind to see if
there is any memory leakage
//my proggram in C
struct tree_node {
int data;
struct tree_node *left, *right;
}
typedef struct nodeT {
int key;
struct nodeT *left, *right;
} nodeT, *treeT;
int main(){
while (TRUE) {
printf(\"> \");
line = GetLine();
ch = toupper(line[0]);
switch (ch) {
case \'I\': insert(); break;
case \'F\': find(); break;
case \'D\': delete(); break;
case \'LI\': listInorder; break;
case \'LPR\': listPreorder(); break;
case \'LPO\': listPostorder(); break;
case \'MAX\': max(); break;
case \'min\': min(); break;
case \'H\': height(); break;
case \'C\': count(); break;
case \'S\': sum(); break;
case \'Q\': exit(0);
default:printf(\"Illegal command\ \"); break;
}
}
}
nodeT *FindNode(nodeT *t, int key){
while(t !=NULL) {
if (key == t->key) return t;
if (key < t->key) {
t = t->left;
} else {
t = t->right;
}
return NULL;
}
void delete(nodeT **p){
nodeT
*target;
target=*p;
if (target->left==NULL && target->right==NULL) {
*p=NULL;
} else if (target->left == NULL) {
*p=target->right;
} else
if (target->right == NULL) {
*p=target->left;
} else {
/* target has two children, see next slide */
}
free(target);
}
void listInorder(nodeT *T){
if (t != NULL) {
DisplayTree(t->left);
printf(“%d “, t->key);
DisplayTree(t->right);
}
}
void listPreorder(nodeT *t) {
if (t != NULL) {
printf(“%d “, t->key);
DisplayTree(t->left);
DisplayTree(t->right);
}
}
void listPostOrder(nodeT *t){
if (t != NULL) {
DisplayTree(t->left);
DisplayTree(t->right);
printf(“%d “, t->key);
}
}
void intsert(nodeT **tptr, int key){
nodeT*t, *tmp;
t=*tptr;
if (t == NULL) {
tmp=New(nodeT*);
tmp->key = key;
tmp->left=tmp->right=NULL;
*tptr=tmp;
return;
}
if (key < t->key) {
InsertNode
(&t->left, key);
} else {
InsertNode(&t->right, key);
}
}
int height(nodeT *t){
if (t == NULL)
return 0;
else
return (1 + maximumof(
height(t->left),
height(t->right)) );
}
int sum(struct tree_node *p){
if (p == NULL)
return 0;
else
return (p->data +
sum(p->left) +
sum(p->right) );
}
Solution
1. /*
2. * Java Program to Implement Binary Search Tree
3. */
4.
5. import java.util.Scanner;
6.
7. /* Class BSTNode */
8. cl.
-- USING UNITY TRYING TO CREATE A CLICK TO PATH- THAT YOU CLICK ON AND.pdfganisyedtrd
// USING UNITY TRYING TO CREATE A CLICK TO PATH, THAT YOU CLICK ON AND
THE AGENT/AVATAR FOLLOWS THE BEST PATH TO GET THERE
// AT THE SAME TIME THERE IS A GUARD CHASING THE AGENT USING
AWARENESS AND PAHTFINDING.
//THIS IS THE MapManager.cs the Agent.cs I could upload it
using System.Collections;
using System.Collections.Generic;
using System.IO;
using UnityEngine;
using UnityEngine.UI;
// Custom struct to hold the per-tile information needed for the A* pathing search
public struct grid_cell
{
public bool visited;
public bool isBlocked;
public Vector2Int parent;
public float g, h, f;
}
public class MapManager : MonoBehaviour
{
// fixed map size for simplicity - map file must match
public const int WIDTH = 12;
public const int HEIGHT = 12;
// need to know tile size (color for debugging)
private Vector2 TILE_SIZE;
private Color TILE_COLOR;
// prefab tiles (and debugging labels)
public GameObject[] _tilePrefabs;
public GameObject _labelPrefab;
public GameObject _uiCanvas;
// A* pathfinding array and queue
private grid_cell[,] _map = new grid_cell[WIDTH, HEIGHT];
private List<KeyValuePair<float, Vector2Int>> _openList = new List<KeyValuePair<float,
Vector2Int>>();
// references to tile spriterenderers and tile labels for debugging
private SpriteRenderer[,] _tiles = new SpriteRenderer[WIDTH, HEIGHT];
private Text[,] _labels = new Text[WIDTH, HEIGHT];
// steps is a convenient way to generate the 8 children of a grid square
private Vector2Int[] _steps = new Vector2Int[8];
void Start()
{
TILE_SIZE = _tilePrefabs[0].transform.GetComponent<SpriteRenderer>()
.bounds.extents * 2;
// load map and create tiles
readMapFile();
// for debugging, store the color of an unblocked tile (for changing them back)
TILE_COLOR = _tiles[0,0].color;
// store "step" vectors for the four cardinal directions
_steps[0].x = -1; _steps[0].y = 0;
_steps[1].x = 0; _steps[1].y = -1;
_steps[2].x = 0; _steps[2].y = 1;
_steps[3].x = 1; _steps[3].y = 0;
// and the four diagonal directions
_steps[4].x = 1; _steps[4].y = 1;
_steps[5].x = 1; _steps[5].y = -1;
_steps[6].x = -1; _steps[6].y = 1;
_steps[7].x = -1; _steps[7].y = -1;
}
/*********************************************************************************************
Collision with blocked tiles (walls)
- called by agents
- returns a response vector indicating the amount to "push" the agent out of the walls
- (0,0) indicates no collisions happening
*/
public Vector2 checkBlockedCollision(Vector2 pos, Vector2 extents)
{
// convert the world position that we're checking to the coordinates of a grid cell
Vector2Int posGC = vectorToGC(pos);
// loop over the diagonal steps to check the diagonally-adjacent cells
// check those first, because a diagonal collision implies two cardinal direction collisions
for (int si=4;si<_steps.Length;si++) {
// for each diagonal neighbor
Vector2Int step = _steps[si];
Vector2Int neighbor = posGC + step;
// if it's not on the map or not blocked, then no collision possible
if (!onMap(neighbor)) continue;
if.
Code reviews are vital for ensuring good code quality. They serve as one of our last lines of defense against bugs and subpar code reaching production.
Yet, they often turn into annoying tasks riddled with frustration, hostility, unclear feedback and lack of standards. How can we improve this crucial process?
In this session we will cover:
- The Art of Effective Code Reviews
- Streamlining the Review Process
- Elevating Reviews with Automated Tools
By the end of this presentation, you'll have the knowledge on how to organize and improve your code review proces
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfJay Das
With the advent of artificial intelligence or AI tools, project management processes are undergoing a transformative shift. By using tools like ChatGPT, and Bard organizations can empower their leaders and managers to plan, execute, and monitor projects more effectively.
Globus Connect Server Deep Dive - GlobusWorld 2024Globus
We explore the Globus Connect Server (GCS) architecture and experiment with advanced configuration options and use cases. This content is targeted at system administrators who are familiar with GCS and currently operate—or are planning to operate—broader deployments at their institution.
TROUBLESHOOTING 9 TYPES OF OUTOFMEMORYERRORTier1 app
Even though at surface level ‘java.lang.OutOfMemoryError’ appears as one single error; underlyingly there are 9 types of OutOfMemoryError. Each type of OutOfMemoryError has different causes, diagnosis approaches and solutions. This session equips you with the knowledge, tools, and techniques needed to troubleshoot and conquer OutOfMemoryError in all its forms, ensuring smoother, more efficient Java applications.
OpenFOAM solver for Helmholtz equation, helmholtzFoam / helmholtzBubbleFoamtakuyayamamoto1800
In this slide, we show the simulation example and the way to compile this solver.
In this solver, the Helmholtz equation can be solved by helmholtzFoam. Also, the Helmholtz equation with uniformly dispersed bubbles can be simulated by helmholtzBubbleFoam.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Unleash Unlimited Potential with One-Time Purchase
BoxLang is more than just a language; it's a community. By choosing a Visionary License, you're not just investing in your success, you're actively contributing to the ongoing development and support of BoxLang.
Exploring Innovations in Data Repository Solutions - Insights from the U.S. G...Globus
The U.S. Geological Survey (USGS) has made substantial investments in meeting evolving scientific, technical, and policy driven demands on storing, managing, and delivering data. As these demands continue to grow in complexity and scale, the USGS must continue to explore innovative solutions to improve its management, curation, sharing, delivering, and preservation approaches for large-scale research data. Supporting these needs, the USGS has partnered with the University of Chicago-Globus to research and develop advanced repository components and workflows leveraging its current investment in Globus. The primary outcome of this partnership includes the development of a prototype enterprise repository, driven by USGS Data Release requirements, through exploration and implementation of the entire suite of the Globus platform offerings, including Globus Flow, Globus Auth, Globus Transfer, and Globus Search. This presentation will provide insights into this research partnership, introduce the unique requirements and challenges being addressed and provide relevant project progress.
Check out the webinar slides to learn more about how XfilesPro transforms Salesforce document management by leveraging its world-class applications. For more details, please connect with sales@xfilespro.com
If you want to watch the on-demand webinar, please click here: https://www.xfilespro.com/webinars/salesforce-document-management-2-0-smarter-faster-better/
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Globus
Large Language Models (LLMs) are currently the center of attention in the tech world, particularly for their potential to advance research. In this presentation, we'll explore a straightforward and effective method for quickly initiating inference runs on supercomputers using the vLLM tool with Globus Compute, specifically on the Polaris system at ALCF. We'll begin by briefly discussing the popularity and applications of LLMs in various fields. Following this, we will introduce the vLLM tool, and explain how it integrates with Globus Compute to efficiently manage LLM operations on Polaris. Attendees will learn the practical aspects of setting up and remotely triggering LLMs from local machines, focusing on ease of use and efficiency. This talk is ideal for researchers and practitioners looking to leverage the power of LLMs in their work, offering a clear guide to harnessing supercomputing resources for quick and effective LLM inference.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
SOCRadar Research Team: Latest Activities of IntelBrokerSOCRadar
The European Union Agency for Law Enforcement Cooperation (Europol) has suffered an alleged data breach after a notorious threat actor claimed to have exfiltrated data from its systems. Infamous data leaker IntelBroker posted on the even more infamous BreachForums hacking forum, saying that Europol suffered a data breach this month.
The alleged breach affected Europol agencies CCSE, EC3, Europol Platform for Experts, Law Enforcement Forum, and SIRIUS. Infiltration of these entities can disrupt ongoing investigations and compromise sensitive intelligence shared among international law enforcement agencies.
However, this is neither the first nor the last activity of IntekBroker. We have compiled for you what happened in the last few days. To track such hacker activities on dark web sources like hacker forums, private Telegram channels, and other hidden platforms where cyber threats often originate, you can check SOCRadar’s Dark Web News.
Stay Informed on Threat Actors’ Activity on the Dark Web with SOCRadar!
Paketo Buildpacks : la meilleure façon de construire des images OCI? DevopsDa...Anthony Dahanne
Les Buildpacks existent depuis plus de 10 ans ! D’abord, ils étaient utilisés pour détecter et construire une application avant de la déployer sur certains PaaS. Ensuite, nous avons pu créer des images Docker (OCI) avec leur dernière génération, les Cloud Native Buildpacks (CNCF en incubation). Sont-ils une bonne alternative au Dockerfile ? Que sont les buildpacks Paketo ? Quelles communautés les soutiennent et comment ?
Venez le découvrir lors de cette session ignite
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
3. KENDRIYA VIDYALAYA (NO 1)
NARIMEDU MADURAI-625002
COMPUTER SCIENCE
2013-2014
BONA FIDE CERTIFICATE
This is to certify that this project entitled “LIBRARY
MANAGEMENT SYSTEM” is a record of bona fide work carried
out by Vishnuprasad.V.P in Computer Science
prescribed by Kendriya Vidyalaya, Narimedu, Madurai -
625002.
ROLL NUMBER: DATE :
INTERNAL EXAMINER : PRINCIPAL :
EXTERNAL EXAMINER :
4. DECLARATION
I hereby declare that the project work entitled
“LIBRARY MANAGEMENT SYSTEM” submitted to KENDRIYA
VIDYALAYA NO.1, MADURAI for the subject Computer Science
under the guidance of MR. AMAN GUPTA is a record of
original work done by me. I further declare that this
project or any part of it has not been submitted elsewhere
for any other class.
Class:
Place:
Date:
5. ACKNOWLEDGEMENT
First and foremost, I praise and thank the god almighty from the
bottom of my heart, he who has been an unfailing source of
strength, comfort and inspiration in the completion of this project
work.
I wish to express my sincere thanks to Mr.C.MUTHIAH
Principal, Kendriya Vidyalaya (No.1), Madurai, for the successful
outcome of this project work.
I wish to express my deep and profound sense of gratitude to my
teacher and guiding light Mr. AMAN GUPTA (PGT CS) for his
expert and valuable guidance, comments and suggestions.
I also express my gratitude to my parents and friends who have
helped me in preparing this project.
7. Coding
#include <iostream.h>
#include <fstream.h>
#include <process.h>
#include <string.h>
#include <stdlib.h>
#include <stdio.h>
#include <ctype.h>
#include <conio.h>
#include<dos.h>
//STRUCTURE THAT INITIALIZES ALL THE VARIABLES
//____________________________________________
struct data
{
int tcode;
char tname[50];
char tauthor[50];
int tcopies;
float tprice;
int tavail;
}b1;
//CLASS THAT CONTROLS ALL FUNCTIONS IN THE MENU
//_____________________________________________
class MENU
{
public:
void introduction();
void main_menu();
void edit_menu() ;
void edit_book() ;
void edit_member() ;
void password();
};
//CLASS CONTAINING FUNCTIONS RELATED TO BOOKS
8. //___________________________________________
class BOOK
{
public :
void list(void) ;
char *bookname(int) ;
protected :
void add_new_book(int, char tname[33], char tauthor[26], float, int , int) ;
void update_copies(int, int, int) ;
void deletion(void) ;
int book_found(int) ;
int bookname_found(char []) ;
int recordno(int) ;
int available(int) ;
char *authorname(int) ;
float bookprice(int) ;
int no_of_copies(int) ;
int bookcodeof(char[]) ;
void display(int) ;
int reccount(void) ;
private :
int bookcode, copies ;
char name[40], author[27] ;
float price ;
int avail ;
};
//CLASS GOVERNING FUNCTIONS RELATED TO MEMBERS
//____________________________________________
class MEMBER
{
public :
void list(void) ;
protected :
void add_mem(int, int, char [], char [], char[], int, int, int) ;
int member_found(int) ;
void update_book(int, int, int, int, int) ;
char *membername(int) ;
char *memberphone(int) ;
char *memberaddress(int) ;
int recordno(int) ;
int lastcode(void) ;
int issued(int) ;
int fine(int) ;
9. void display(int) ;
void delete_rec(int) ;
private :
int memcode, bookcode ;
char name[27], phone[10], address[50] ;
int dd, mm, yy ; // DATE OF RETURNING THE BOOK //
};
//CLASS CONTAINING FUNCTIONS TO ISSUE, RETURN A BOOK, ETC..
//_________________________________________________________
class WORKING : public BOOK, public MEMBER
{
public :
void issuebook(void) ;
void returnbook(void) ;
void add_book(void) ;
void add_member(void) ;
void modify_book(void) ;
void modify_member(void) ;
void delete_book(void) ;
void delete_member(void) ;
} ;
//CLASS CONTAINING FUNCTIONS RELATED TO DATE
//__________________________________________
class DATE
{
public :
void extend_date(int,int,int,int) ;
int diff(int, int, int, int, int, int) ;
int day, mon, year ;
} ;
//FUNCTION TO EXTEND THE DATE BY 15 DAYS
//______________________________________
void DATE :: extend_date(int d1, int m1, int y1, int days)
{
static int month[] = {31,29,31,30,31,30,31,31,30,31,30,31};
for (int i=1; i<=days; i++)
{
10. d1++ ;
if ((d1 > month[m1-1]) || (y1%4 != 0 && m1 == 2 && d1 > 28))
{
d1 = 1 ;
m1++ ;
}
if (m1 > 12)
{
m1 = 1 ;
y1++ ;
}
}
day = d1 ;
mon = m1 ;
year = y1 ;
}
//FUNCTION TO RETURN THE DIFFERENCE B/W TWO DATES
//_______________________________________________
int DATE :: diff(int d1, int m1, int y1, int d2, int m2, int y2)
{
int days = 0 ;
if ((y2<y1) || (y2==y1 && m2<m1) || (y2==y1 && m2==m1 && d2<d1 ))
return days ;
static int month[] = {31,29,31,30,31,30,31,31,30,31,30,31} ;
while (d1 != d2 || m1 != m2 || y1 != y2)
{
days++ ;
d1++ ;
if ((d1 > month[m1-1]) || (y1%4 != 0 && m1 == 2 && d1 > 28))
{
d1 = 1 ;
m1++ ;
}
if (m1 > 12)
{
m1 = 1 ;
y1++ ;
}
}
return days ;
}
//FUNCTION TO DISPLAY MAIN MENU AND CONTROL ALL THE FUNCTIONS PRESENT IN IT
//_________________________________________________________________________
11. void MENU::main_menu()
{
while(1)
{
int ch;
clrscr();
gotoxy(26,2);
textbackground(WHITE);
textcolor(BLACK);
cprintf("WELCOME TO THE LIBRARY OF CONGRESS");
textcolor(BLACK);
gotoxy(26,3);
cout<<"***********************************";
gotoxy(31,7);
cout<<"1. INTRODUCTION";
gotoxy(31,8);
cout<<"2. ADD NEW BOOK";
gotoxy(31,9);
cout<<"3. ADD NEW MEMBER";
gotoxy(31,10);
cout<<"4. ISSUE A BOOK";
gotoxy(31,11);
cout<<"5. RETURN A BOOK";
gotoxy(31,12);
cout<<"6. LIST OF BOOKS";
gotoxy(31,13);
cout <<"7. LIST OF MEMBERS" ;
gotoxy(31,14) ;
cout <<"8. EDIT" ;
gotoxy(31,15) ;
cout <<"0. QUIT" ;
gotoxy(31,21);
cout <<"Enter your choice : " ;
cin>>ch;
WORKING W;
switch(ch)
{
case 1:
introduction();
break;
case 2:
W.add_book();
break;
12. case 3:
W.add_member();
break;
case 4:
W.issuebook();
break;
case 5:
W.returnbook() ;
break;
case 6:
BOOK B;
B.list();
break;
case 7:
MEMBER M;
M.list();
break;
case 8:
password();
break;
case 0:
exit(0);
default:
gotoxy(34,17);
cout<<"WRONG CHOICE!!";
}
getch();
}
}
//FUNCTION TO DISPLAY THE INTRODUCTION
//____________________________________
void MENU::introduction()
13. {
clrscr();
gotoxy(23,2);
cout<<"WELCOME TO LIBRARY MANAGEMENT SYSTEM";
gotoxy(23,3);
cout<<".....................................";
gotoxy(30,5);
cout<<"THE LIBRARY OF CONGRESS";
gotoxy(30,6);
cout<<"_______________________";
gotoxy(8,9);
cout <<"This is a project having the facility of maintaining the records" ;
gotoxy(29,11) ;
cout <<"of BOOKS and MEMBERS." ;
gotoxy(15,14) ;
cout <<"This project can hold the records of more than " ;
gotoxy(33,16) ;
cout <<"10,000 books" ;
gotoxy(2,25);
cout<<"AUTHORS : K.M.Subangan Rao, V. Muthukrishnan, V.P.
Vishnuprasad";
gotoxy(27,20);
textcolor(WHITE);
cout<<"PRESS ANY KEY TO CONTINUE : ";
textcolor(BLACK+BLINK);
getch();
}
//FUNCTION TO GET PASSWORD
//_________________________
void MENU:: password()
{
char pass1,pass2,pass3,ch;
clrscr();
gotoxy(27,12);
cout<<"ENTER PASSWORD : ";
pass1=getch();
cout<<"*";
pass2=getch();
cout<<"*";
pass3=getch();
cout<<"*";
if(pass1=='l'&&pass2=='i'&&pass3=='b')
{
gotoxy(28,13);
14. cout<<"WRONG PASSWORD!!";
main_menu();
}
else
{
clrscr();
gotoxy(28,13);
cout<<"WRONG PASSWORD!!";
}
}
//FUNCTION TO ASCERTAIN WHETHER THE BOOK CODE OR NAME IS PRESENT
//_____________________________________________________________
int BOOK ::book_found(int tcode)
{
fstream file;
file.open("BOOK.DAT",ios::in);
file.seekg(0,ios::beg);
int f;
while(file.read((char*)this,sizeof(BOOK)))
{
if(bookcode==tcode)
{
f=1;
break;
}
}
file.close();
return f;
}
int BOOK :: bookname_found(char t1code[35])
{
fstream file;
file.open("BOOK.DAT",ios::in);
file.seekg(0,ios::beg);
int g=0;
while(file.read((char*)this,sizeof(BOOK)))
{
if(!strcmpi(name,t1code))
{
g=1;
break;
}
15. }
file.close();
return g;
}
//FUNCTION TO RETURN THE RECORD NUMBER FOR A GIVEN BOOK
//______________________________________________________
int BOOK :: recordno(int tcode)
{
fstream file ;
file.open("BOOK.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int count=0 ;
while (file.read((char *) this, sizeof(BOOK)))
{
count++ ;
if (bookcode == tcode)
break ;
}
file.close() ;
return count ;
}
//FUNCTION TO RETURN THE AVAILABLE COPIES FOR THE GIVEN BOOK CODE
//_______________________________________________________________
int BOOK :: available(int tcode)
{
fstream file ;
file.open("BOOK.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int tavail=0 ;
while (file.read((char *) this, sizeof(BOOK)))
{
if (bookcode == tcode)
{
tavail = avail ;
break ;
}
}
16. file.close() ;
return tavail ;
}
//FUNCTION TO RETURN THE NUMBER OF COPIES FOR THE GIVEN BOOK CODE
//_______________________________________________________________
int BOOK :: no_of_copies(int tcode)
{
fstream file ;
file.open("BOOK.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int tcopies=0 ;
while (file.read((char *) this, sizeof(BOOK)))
{
if (bookcode == tcode)
{
tcopies = copies ;
break ;
}
}
file.close() ;
return tcopies ;
}
//FUNCTION TO RETURN BOOK NAME OF THE GIVEN BOOK CODE
//___________________________________________________
char *BOOK :: bookname(int tcode)
{
fstream file ;
file.open("BOOK.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
char tname[33] ;
while (file.read((char *) this, sizeof(BOOK)))
{
if (bookcode == tcode)
{
strcpy(tname,name) ;
break ;
}
}
file.close() ;
17. return tname ;
}
//FUNCTION TO RETURN THE NAME OF THE AUTHOR FOR A GIVEN BOOK CODE
//_______________________________________________________________
char *BOOK :: authorname(int tcode)
{
fstream file ;
file.open("BOOK.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
char tauthor[26] ;
while (file.read((char *) this, sizeof(BOOK)))
{
if (bookcode == tcode)
{
strcpy(tauthor,author) ;
break ;
}
}
file.close() ;
return tauthor ;
}
//FUNCTION TO RETURN THE PRICE OF A BOOK WHEN BOOK CODE IS ENTERED
//________________________________________________________________
float BOOK :: bookprice(int tcode)
{
fstream file ;
file.open("BOOK.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
float tprice=0.0 ;
while (file.read((char *) this, sizeof(BOOK)))
{
if (bookcode == tcode)
{
tprice = price ;
break ;
}
}
file.close() ;
18. return tprice ;
}
//FUNCTION TO RETURN THE BOOK CODE OF A GIVEN BOOK NAME
//_____________________________________________________
int BOOK :: bookcodeof(char t1code[33])
{
fstream file ;
file.open("BOOK.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int tcode=0 ;
while (file.read((char *) this, sizeof(BOOK)))
{
if (!strcmpi(name,t1code))
{
tcode = bookcode ;
break ;
}
}
file.close() ;
return tcode ;
}
//FUNCTION TO RETURN THE NUMBER OF RECORDS IN THE FILE
//____________________________________________________
int BOOK :: reccount(void)
{
fstream file ;
file.open("BOOK.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int count=0 ;
while (file.read((char *) this, sizeof(BOOK)))
count++ ;
file.close() ;
return count ;
}
//FUNCTION TO ADD A RECORD TO THE FILE
//____________________________________
19. void BOOK :: add_new_book(int tcode, char tname[33], char tauthor[26], float tprice, int tcopies,
int tavail)
{
fstream file ;
file.open("BOOK.DAT", ios::app,ios::out) ;
bookcode = tcode ;
strcpy(name,tname) ;
strcpy(author,tauthor) ;
price = tprice ;
copies = tcopies ;
avail = tavail ;
file.write((char*)&b1,sizeof(b1));
file.close() ;
}
//FUNCTION TO DISPLAY THE RECORDS FOR A GIVEN BOOK CODE
//_____________________________________________________
void BOOK :: display(int tcode)
{
fstream file ;
file.open("BOOK.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
while (file.read((char *) this, sizeof(BOOK)))
{
if (bookcode == tcode)
{
gotoxy(5,5) ;
cout <<"Book Code : " <<bookcode ;
gotoxy(5,7) ;
cout <<"Book Name : " <<name ;
gotoxy(5,8) ;
cout <<"Author Name : " <<author ;
gotoxy(5,9) ;
cout <<"Price : Rs." <<price ;
gotoxy(5,10) ;
cout <<"No. of copies existing : " <<copies ;
gotoxy(5,11) ;
cout <<"No. of copies available : " <<avail ;
break ;
}
}
file.close() ;
}
20. //FUNCTION TO DISPLAY THE LIST OF BOOKS
//_____________________________________
void BOOK :: list(void)
{
clrscr();
int row=6;
gotoxy(32,2);
cout <<" LIST OF BOOKS" ;
gotoxy(32,3) ;
cout <<" ~~~~~~~~~~~~~~~" ;
gotoxy(1,4) ;
cout <<" CODE BOOK NAME AUTHOR PRICE COPIES " ;
gotoxy(1,5) ;
cout << "
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~";
fstream file;
int i=0;
file.open("BOOK.DAT",ios::in|ios::out);
while(1)
{
file.read((char*)&b1,sizeof(b1));
if(file.eof())
break;
cout<<"n";
gotoxy(4,row);
cout<<b1.tcode;
gotoxy(10,row);
cout<<b1.tname;
gotoxy(36,row);
cout<<b1.tauthor;
gotoxy(60,row);
cout<<b1.tprice;
gotoxy(75,row);
cout<<b1.tcopies;
b1.tavail=b1.tcopies;
gotoxy(54,row+1) ;
cprintf("STATUS: ") ;
textcolor(BLACK+BLINK) ;
cprintf("%d copies available",b1.tavail) ;
textbackground(BLACK) ; textcolor(LIGHTGRAY) ;
row=row+2;
21. }
file.close();
}
//FUNCTION TO CHECK WHETHER THE MEMBER CODE IS VALID OR NOT
//_________________________________________________________
int MEMBER :: member_found(int mcode){return 0;}
{
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int found=0 ;
while (file.read((char *) this, sizeof(MEMBER)))
{
if (memcode == mcode)
{
found = 1 ;
break ;
}
}
file.close() ;
return found ;
}
//FUNCTION TO RETURN 0 IF THE MEMBER HAS NOT ISSUED ANY BOOK
//__________________________________________________________
int MEMBER :: issued(int mcode){return 1;}
{
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int missue=0 ;
while (file.read((char *) this, sizeof(MEMBER)))
{
if (memcode == mcode)
{
missue = bookcode ;
break ;
}
}
22. file.close() ;
return missue ;
}
//FUNCTION TO CALCULATE & RETURN FINE AMOUNT FOR A GIVEN MEMBER CODE
//_________________________________________________________________
int MEMBER :: fine(int mcode)
{
DATE D ;
int d1, m1, y1 ;
struct date d;
getdate(&d);
d1 = d.da_day ;
m1 = d.da_mon ;
y1 = d.da_year ;
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int days, t_fine ;
while (file.read((char *) this, sizeof(MEMBER)))
{
if (memcode == mcode)
{
days = D.diff(dd,mm,yy,d1,m1,y1) ;
t_fine = days * 2 ;
break ;
}
}
file.close() ;
return t_fine ;
}
//FUNCTION TO RETURN THE LAST CODE OF THE MEMBER FILE
//___________________________________________________
int MEMBER :: lastcode(void)
{
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int mcode=0 ;
while (file.read((char *) this, sizeof(MEMBER)))
23. mcode = memcode ;
file.close() ;
return mcode ;
}
//FUNCTION TO RETURN THE MEMBER NAME FOR A GIVEN MEMBER CODE
//__________________________________________________________
char *MEMBER :: membername(int mcode)
{
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
char mname[26] ;
while (file.read((char *) this, sizeof(MEMBER)))
{
if (memcode == mcode)
{
strcpy(mname,name) ;
break ;
}
}
file.close() ;
return mname ;
}
//FUNCTION TO RETURN THE PHONE MEMBER FOR A GIVEN MEMBER CODE
//___________________________________________________________
char *MEMBER :: memberphone(int mcode)
{
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
char mphone[10] ;
while (file.read((char *) this, sizeof(MEMBER)))
{
if (memcode == mcode)
{
strcpy(mphone,phone) ;
break ;
}
}
24. file.close() ;
return mphone ;
}
//FUNCTION TO RETURN THE ADDRESS FOR A GIVEN MEMBER CODE
//______________________________________________________
char *MEMBER :: memberaddress(int mcode)
{
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
char maddress[33] ;
while (file.read((char *) this, sizeof(MEMBER)))
{
if (memcode == mcode)
{
strcpy(maddress,address) ;
break ;
}
}
file.close() ;
return maddress ;
}
//FUNCTION TO RETURN THE RECORD NUMBER FOR THE GIVEN MEMBER CODE
//______________________________________________________________
int MEMBER :: recordno(int mcode)
{
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
int count=0 ;
while (file.read((char *) this, sizeof(MEMBER)))
{
count++ ;
if (memcode == mcode)
break ;
}
file.close() ;
return count ;
}
25. //FUNCTION TO ADD RECORD INTO THE FILE FOR A GIVEN MEMBER CODE
//____________________________________________________________
void MEMBER :: add_mem(int mcode, int bcode, char mname[26], char maddress[33], char
mphone[10], int d1, int m1, int y1)
{
fstream file ;
file.open("MEMBER.DAT", ios::app) ;
memcode = mcode ;
bookcode = bcode ;
strcpy(name,mname) ;
strcpy(address,maddress) ;
strcpy(phone,mphone) ;
dd = d1 ;
mm = m1 ;
yy = y1 ;
file.write((char *) this, sizeof(MEMBER)) ;
file.close() ;
}
//FUNCTION TO DISPLAY THE RECORD FOR A GIVEN MEMBER CODE
//______________________________________________________
void MEMBER :: display(int mcode)
{
fstream file ;
file.open("MEMBER.DAT", ios::in);
file.seekg(0,ios::beg) ;
while (file.read((char *) this, sizeof(MEMBER)))
{
if (memcode == mcode)
{
gotoxy(5,3) ;
cout <<" Member Code # " <<mcode ;
gotoxy(5,4) ;
cout <<" ~~~~~~~~~~~~~~~~~" ;
gotoxy(5,6) ;
cout <<"Name : " <<name ;
gotoxy(5,7) ;
cout <<"Phone No : " <<phone ;
gotoxy(5,8) ;
cout <<"Address : " <<address ;
break ;
}
26. }
file.close() ;
}
//FUNCTION TO DISPLAY THE LIST OF MEMBERS
//_______________________________________
void MEMBER :: list(void)
{
clrscr() ;
BOOK B ;
int row = 6 , found=0, flag=0 ;
char ch ;
gotoxy(32,2) ;
cout <<"LIST OF MEMBERS" ;
gotoxy(31,3) ;
cout <<"===================" ;
gotoxy(1,4) ;
cout <<" CODE BOOK CODE NAME PHONE" ;
gotoxy(1,5) ;
cout
<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~" ;
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
file.seekg(0,ios::beg) ;
while (file.read((char *) this, sizeof(MEMBER)))
{
flag = 0 ;
delay(20) ;
found = 1 ;
gotoxy(2,row) ;
cout <<memcode ;
gotoxy(10,row) ;
cout <<bookcode ;
gotoxy(19,row) ;
cout <<name ;
gotoxy(48,row) ;
cout <<phone ;
textbackground(WHITE) ; textcolor(BLACK) ;
gotoxy(7,row+1) ;
if (bookcode == 0)
cprintf("BOOK NAME: (Not Issued)") ;
else
27. {
cprintf("BOOK NAME: %s",B.bookname(bookcode)) ;
gotoxy(42,row+1) ;
cprintf("Date of return: ") ;
textcolor(BLACK+BLINK) ;
cprintf("%d/%d/%d",dd,mm,yy) ;
}
textbackground(BLACK) ; textcolor(LIGHTGRAY) ;
if ( row == 22 )
{
flag = 1 ;
row = 6 ;
gotoxy(1,25) ;
cout <<"Press any key to continue or Press <ESC> to exit" ;
ch = getch() ;
if (ch == 27)
break ;
clrscr() ;
gotoxy(32,2) ;
cout <<"LIST OF MEMBERS" ;
gotoxy(31,3) ;
cout <<"==================" ;
gotoxy(1,4) ;
cout <<"CODE BOOK CODE NAME PHONE" ;
gotoxy(1,5) ;
cout
<<"~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~" ;
}
else
row = row + 2 ;
}
if (!found)
{
gotoxy(5,10) ;
cout <<"nRecords not found" ;
}
if (!flag)
{
gotoxy(1,25) ;
cout <<"Press any key to continue..." ;
getche() ;
}
file.close () ;
28. }
//FUNCTION TO UPDATE THE RECORD IN THE FILE FOR A GIVEN BOOK CODE
//_______________________________________________________________
void BOOK :: update_copies(int tcode, int tcopies, int tavail)
{
fstream file ;
file.open("BOOK.DAT", ios::in) ;
fstream temp ;
temp.open("temp.dat", ios::out) ;
file.seekg(0,ios::beg) ;
while ( !file.eof() )
{
file.read((char *) this, sizeof(BOOK)) ;
if ( file.eof() )
break ;
if ( bookcode == tcode )
{
copies = tcopies ;
avail = tavail ;
temp.write((char *) this, sizeof(BOOK)) ;
}
else
temp.write((char *) this, sizeof(BOOK)) ;
}
file.close() ;
temp.close() ;
file.open("BOOK.DAT", ios::out) ;
temp.open("temp.dat", ios::in) ;
temp.seekg(0,ios::beg) ;
while ( !temp.eof() )
{
temp.read((char *) this, sizeof(BOOK)) ;
if ( temp.eof() )
break ;
file.write((char *) this, sizeof(BOOK)) ;
}
file.close() ;
temp.close() ;
}
29. //FUNCTION TO GET DATA TO ADD RECORD INTO THE BOOK FILE
//______________________________________________________
void WORKING :: add_book(void)
{
BOOK B;
char c;
clrscr();
fstream file("BOOK.DAT",ios::in|ios::app);
file.seekg(0,ios::end);
int pos=file.tellg();
gotoxy(25,9);
cout<<"Code No. : ";
b1.tcode=(pos/sizeof(B))+1 ;
cout<<b1.tcode;
do
{
b1.tcode++;
gotoxy(30,5);
cout<<"A D D B O O K S";
gotoxy(30,6);
cout<<"-----------------";
gotoxy(25,11);
cout<<"Name of the Book : ";
gotoxy(25,13);
cout<<"Name of the Author : ";
gotoxy(25,15);
cout<<"Price : ";
gotoxy(25,17);
cout<<"Number of Copies: ";
gotoxy(49,11);
gets(b1.tname);
gotoxy(49,13);
gets(b1.tauthor);
gotoxy(49,15);
cin>>b1.tprice;
gotoxy(49,17);
cin>>b1.tcopies;
char ch;
gotoxy(25,20);
cout<<"Do you want to save?(y/n) ";
cin>>ch;
if(ch=='y'||ch=='Y')
30. {
clrscr();
add_new_book(b1.tcode,b1.tname,b1.tauthor,b1.tprice,b1.tcopies,b1.tavail);
}
b1.tavail = available(b1.tcode) + b1.tcopies ;
b1.tcopies = no_of_copies(b1.tcode) + b1.tcopies ;
gotoxy(25,23);
cout<<"Do you want to add more? (y/n) ";
cin>>c;
}while(c=='y');
file.close();
}
//FUNCTION TO DELETE THE RECORD FOR A GIVEN MEMBER CODE
//_____________________________________________________
void MEMBER :: delete_rec(int mcode)
{
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
fstream temp ;
temp.open("temp.dat", ios::out) ;
file.seekg(0,ios::beg) ;
while ( !file.eof() )
{
file.read((char *) this, sizeof(MEMBER)) ;
if ( file.eof() )
break ;
if ( memcode != mcode )
temp.write((char *) this, sizeof(MEMBER)) ;
}
file.close() ;
temp.close() ;
file.open("MEMBER.DAT", ios::out) ;
temp.open("temp.dat", ios::in) ;
temp.seekg(0,ios::beg) ;
while ( !temp.eof() )
{
temp.read((char *) this, sizeof(MEMBER)) ;
if ( temp.eof() )
break ;
31. file.write((char *) this, sizeof(MEMBER)) ;
}
file.close() ;
temp.close() ;
}
//FUNCTION TO GET DATA TO ADDD RECORD INTO THE MEMBER FILE
//________________________________________________________
void WORKING :: add_member(void)
{
char ch ;
int mcode, bcode ;
char mname[31], mphone[11], maddress[41] ;
int d1, m1, y1 ;
mcode = lastcode() ;
if (mcode == 0)
{
add_mem(mcode,0,"null","null","null",0,0,0) ;
MEMBER::delete_rec(mcode) ;
}
mcode++ ;
do
{
int valid=0 ;
clrscr() ;
gotoxy(28,3) ;
cout <<"ADDITION OF THE MEMBERS" ;
gotoxy(28,4) ;
cout <<"------------------------";
gotoxy(72,1) ;
cout <<"<0>=Exit" ;
gotoxy(5,7) ;
cout <<" # Member Code " <<mcode ;
gotoxy(5,8) ;
cout <<"_______________" ;
gotoxy(5,10) ;
cout <<"Name : " ;
gotoxy(5,12) ;
cout <<"Phone No. : " ;
gotoxy(5,14) ;
cout <<"Address : " ;
do
{
32. valid = 1 ;
gotoxy(5,25) ; clreol() ;
cout <<"Enter the name of the New Member : " ;
gotoxy(15,10) ; clreol() ;
gets(mname) ;
strupr(mname) ;
if (mname[0] == '0')
return ;
if (strlen(mname) < 1 || strlen(mname) > 30)
{
valid = 0 ;
gotoxy(5,25) ; clreol() ;
cout <<"7Enter correctly (Range: 1..30)" ;
getch() ;
}
}
while (!valid) ;
do
{
valid = 1 ;
gotoxy(5,25) ; clreol() ;
cout <<"Enter Phone no. of the Member or Press <ENTER> for none
: " ;
gotoxy(15,12) ; clreol() ;
gets(mphone) ;
if (mphone[0] == '0')
return ;
if ((strlen(mphone) < 6 && strlen(mphone) > 0) || (strlen(mphone) > 10))
{
valid = 0 ;
gotoxy(5,25) ; clreol() ;
cout <<"7Enter correctly...." ;
getch() ;
}
}
while (!valid) ;
if (strlen(mphone) == 0)
strcpy(mphone,"-") ;
do
33. {
valid = 1 ;
gotoxy(5,25) ; clreol() ;
cout <<"Enter the Address of the New Member: " ;
gotoxy(15,14) ; clreol() ;
gets(maddress) ;
strupr(maddress) ;
if (maddress[0] == '0')
return ;
if (strlen(maddress) < 1 || strlen(maddress) > 32)
{
valid = 0 ;
gotoxy(5,25) ; clreol() ;
cout <<"7Enter correctly (Range: 1..40)" ;
getch() ;
}
}
while (!valid) ;
gotoxy(5,25) ; clreol() ;
do
{
gotoxy(5,17) ; clreol() ;
cout <<"Do you want to save? (y/n) : " ;
ch = getche() ;
ch = toupper(ch) ;
if (ch == '0')
return ;
}
while (ch != 'Y' && ch != 'N') ;
if (ch == 'Y')
{
bcode = 0 ;
d1 = 0 ;
m1 = 0 ;
y1 = 0 ;
add_mem(mcode,bcode,mname,maddress,mphone,d1,m1,y1) ;
mcode++ ;
}
do
{
34. gotoxy(5,19) ; clreol() ;
cout <<"Do you want to add more? (y/n) : " ;
ch = getche() ;
ch = toupper(ch) ;
if (ch == '0')
return ;
}
while (ch != 'Y' && ch != 'N') ;
}
while (ch == 'Y') ;
}
//FUNCTION TO UPDATE THE RECORD FOR A GIVEN MEMBER CODE
//______________________________________________________
void MEMBER :: update_book(int mcode, int tcode, int d1, int m1, int y1)
{
fstream file ;
file.open("MEMBER.DAT", ios::in) ;
fstream temp ;
temp.open("temp.dat", ios::out) ;
file.seekg(0,ios::beg) ;
while ( !file.eof() )
{
file.read((char *) this, sizeof(MEMBER)) ;
if ( file.eof() )
break ;
if ( memcode == mcode )
{
bookcode = tcode ;
dd = d1 ;
mm = m1 ;
yy = y1 ;
temp.write((char *) this, sizeof(MEMBER)) ;
}
else
temp.write((char *) this, sizeof(MEMBER)) ;
}
file.close() ;
temp.close() ;
35. file.open("MEMBER.DAT", ios::out) ;
temp.open("temp.dat", ios::in) ;
temp.seekg(0,ios::beg) ;
while ( !temp.eof() )
{
temp.read((char *) this, sizeof(MEMBER)) ;
if ( temp.eof() )
break ;
file.write((char *) this, sizeof(MEMBER)) ;
}
file.close() ;
temp.close() ;
}
//FUNCTION TO ISSUE THE BOOK
//__________________________
void WORKING :: issuebook(void)
{
BOOK B ;
MEMBER M ;
DATE D ;
char t1code[33], ch ;
int t2code=0, tcode=0, mcode=0 ;
int valid ;
int d1, m1, y1 ;
struct date d;
getdate(&d);
d1 = d.da_day ;
m1 = d.da_mon ;
y1 = d.da_year ;
do
{
valid = 1 ;
while (1)
{
clrscr() ;
gotoxy(5,2) ;
cout <<"Date : " <<d1 <<"/" <<m1 <<"/" <<y1 ;
gotoxy(72,1) ;
36. cout <<"<0>=Exit" ;
gotoxy(5,5) ;
cout <<"Enter Code or Name of the Book to be issued" ;
gotoxy(5,6) ;
cout <<" or " ;
gotoxy(5,7) ;
cout <<"Press <ENTER> for help " ;
gets(t1code);
if (strlen(t1code) == 0)
B.list() ;
else
break ;
}
if ((tcode == 0 && !bookname_found(t1code)) || (tcode != 0 &&
!book_found(tcode)))
{
valid = 0 ;
gotoxy(5,10) ;
cout <<"7Record not found!!" ;
gotoxy(5,11) ;
cout <<"Press <ESC> to exit or any other key to continue..." ;
ch = getch() ;
if (ch == 27)
return ;
}
}
while (!valid) ;
if (tcode == 0)
tcode = bookcodeof(t1code) ;
if (!available(tcode))
{
gotoxy(5,10) ;
cout <<"7Sorry!! Book (" <<bookname(tcode) <<") is not available" ;
gotoxy(5,11) ;
cout <<"Kindly issue any other Book" ;
gotoxy(5,12) ;
cout <<"See List of Books" ;
getch() ;
return ;
}
do
37. {
valid = 1 ;
while (1)
{
clrscr() ;
gotoxy(72,1) ;
cout <<"<0>=Exit" ;
gotoxy(5,2) ;
cout <<"Date : " <<d1 <<"/" <<m1 <<"/" <<y1 ;
gotoxy(5,5) ;
cout <<"Book Name: " <<bookname(tcode) ;
gotoxy(5,7) ;
cout <<"Enter Code no. of the Member" ;
gotoxy(5,8) ;
cout <<" or " ;
gotoxy(5,9) ;
cout <<"Press <ENTER> for help " ;
gets(t1code) ;
if (t1code[0] == '0')
return ;
if (strlen(t1code) == 0)
M.list() ;
else
break ;
}
t2code = atoi(t1code) ;
mcode = t2code ;
if (mcode == 0)
{
valid = 0 ;
gotoxy(5,25) ;
cout <<"7Enter Correctly...." ;
getch() ;
}
if (!member_found(mcode) && valid)
{
valid = 0 ;
gotoxy(5,13) ;
cout <<"7Record not found!!" ;
gotoxy(5,14) ;
cout <<"Press <ESC> to exit or any other key to continue..." ;
ch = getch() ;
38. if (ch == 27)
return ;
}
}
while (!valid) ;
int tcopies, tavail ;
tcopies = no_of_copies(tcode) ; // Member function of BOOK
tavail = available(tcode) - 1 ; // Member function of BOOK
update_copies(tcode,tcopies,tavail) ; // Member function of BOOK
D.extend_date(d1,m1,y1,15) ;
d1 = D.day ;
m1 = D.mon ;
y1 = D.year ;
update_book(mcode,tcode,d1,m1,y1) ; // Member function of MEMBER
gotoxy(5,13) ;
cout <<"7Book has been issued to " <<membername(mcode) ;
gotoxy(5,15) ;
cout <<"Date of Return : " <<d1 <<"/" <<m1 <<"/" <<y1 ;
getch() ;
}
//FUNCTION TO RETURN THE BOOK
//____________________________
void WORKING :: returnbook(void)
{
MEMBER M ;
char t1code[5], ch ;
int t2code=0, mcode=0, valid ;
int d1, m1, y1 ;
struct date d;
getdate(&d);
d1 = d.da_day ;
m1 = d.da_mon ;
y1 = d.da_year ;
do
{
valid = 1 ;
while (1)
{
clrscr() ;
gotoxy(72,1) ;
cout <<"<0>=Exit" ;
gotoxy(5,2) ;
39. cout <<"Date : " <<d1 <<"/" <<m1 <<"/" <<y1 ;
gotoxy(5,7) ;
cout <<"Enter Code no. of the Member:" ;
gotoxy(5,8) ;
cout <<" or " ;
gotoxy(5,9) ;
cout <<"Press <ENTER> for help " ;
gets(t1code) ;
if (t1code[0] == '0')
return ;
if (strlen(t1code) == 0)
M.list() ;
else
break ;
}
if (mcode == 0)
{
valid = 0 ;
gotoxy(5,25) ;
cout <<"7Enter Correctly..." ;
getch() ;
}
if (!member_found(mcode) && valid)
{
valid = 0 ;
gotoxy(5,13) ;
cout <<"7Record not found!!" ;
gotoxy(5,14) ;
cout <<"Press <ESC> to exit or any other key to continue..." ;
ch = getch() ;
if (ch == 27)
return ;
}
if (!issued(mcode) && valid)
{
valid = 0 ;
gotoxy(5,13) ;
cout <<"7Member has no book to return!!" ;
gotoxy(5,14) ;
cout <<"Press <ESC> to exit or any other key to continue..." ;
ch = getch() ;
if (ch == 27)
return ;
}
40. }
while (!valid) ;
int bcode, tcopies, tavail ;
bcode = issued(mcode) ;
gotoxy(5,13) ;
cout <<"Book Code : " <<bcode ;
gotoxy(5,14) ;
cout <<"Book Name : " <<bookname(bcode) ;
tcopies = no_of_copies(bcode) ;
tavail = available(bcode) + 1 ;
int f ;
f = fine(mcode) ;
if (f != 0)
{
gotoxy(5,16) ;
cout <<"You are expected to pay a fine of Rs." <<f <<" due to late
submission";
gotoxy(5,17) ;
cout <<"Please do not delay the Return of Book again..." ;
}
update_copies(bcode,tcopies,tavail) ;
update_book(mcode,0,0,0,0) ;
gotoxy(5,19) ;
cout <<"7Book has been returned..." ;
getch() ;
}
//MAIN FUNCTION
//_____________
void main()
{
MENU menu;
menu.introduction();
menu.main_menu();
}