//list of header files
#include<stdio.h> //contains printf,scanf etc
#include<conio.h> //contains delay(),getch(),gotoxy(),etc.
#include <stdlib.h> // contains exit();
#include<string.h> //contains strcmp(),strcpy(),strlen(),etc
#include<ctype.h> //contains toupper(), tolower(),etc
#include<dos.h> //contains _dos_getdate
#include<time.h>
#include<bios.h>
struct Date
{
int mm,dd,yy;
};
struct books
{
int id;
char stname[20];
char name[20];
char Author[20];
int quantity;
float Price;
int count;
struct Date issued;
struct Date duedate;
};
main()
{
clrscr();
int p,c=0;
while(another=='y')
{
printf("Enter Book ID:");
scanf("%d",&p);
checkid(int t);
if(checkid(t) == 0)
{
printf("\aThe book id already exists\a");
ask current date(int);
if(ask current date(valid date) == 0)
{
printf("\a date is valid\a");
checkcurentpaseed();
}
else
printf("\a date is not valid\a");
returnfunc()
else
printf("\a no such book exits\a");
check currentdate();
int checkid(int t) //check whether the book is exist in library or not
{
rewind(fp);
while(fread(&a,sizeof(a),1,fp)==1)
if(a.id==t)
return 0; //returns 0 if book exits
return 1; //return 1 if it not
}
int t(void) //for time
{
time_t t;
time(&t);
printf("Date and time:%s\n",ctime(&t));
return 0 ;
}
ask current date(int valid date);
int dd, mm, yy; /* given date */
int valid date; /* flag to indicate date validity */
clrscr();
printf("Enter date as dd/mm/yyyy: ");
scanf("%d/%d/%d", &dd, &mm, &yy);
/* determine validity of given date */
valid date= 0;
if (yy != 0) /* check year */
{
if (mm >= 1 && mm <= 12) /* check month */
{
/* determine number of days in given month */
int mdays;
if (mm == 2)
mdays = (yy % 4 == 0 && yy % 100 != 0 || yy % 400 == 0) ? 29 : 28;
else if (mm == 4 || mm == 6 || mm == 9 || mm == 11)
mdays = 30;
else mdays = 31;
if (dd >= 1 && dd <= mdays)
valid date= 1;
}
}
}
checkcurentpaseed()
{
struct dosdate_t d; //for current date
_dos_getdate(&d);
a.issued.dd=d.day;
a.issued.mm=d.month;
a.issued.yy=d.year;
printf("Issued date=%d-%d-%d",a.issued.dd,a.issued.mm,a.issued.yy);
printf("The BOOK of ID %d is issued",a.id);
a.duedate.dd=a.issued.dd+RETURNTIME; //for return date
a.duedate.mm=a.issued.mm;
a.duedate.yy=a.issued.yy;
if(a.duedate.dd>30)
{
a.duedate.mm+=a.duedate.dd/30;
a.duedate.dd-=30;
}
if(a.duedate.mm>12)
{
a.duedate.yy+=a.duedate.mm/12;
a.duedate.mm-=12;
}
if(a.duedate.dd<a.issued.dd)
{
printf("due date passed");
printf('the student already paid);
update()
printf('book**** return sucessfully);
returnfunction();
}
if(days>=15)
printf('the fine is:%d',days*1)
void returnfunction(void)
{
printf( "Selections: " );
scanf( "%d", &choice);
switch ( choice ) {
case 't': /* Note the colon, not a semicolon */
printf('tryagain')
break;
case 'b':
printf('back');
break;
default:
printf( "Bad choice, quitting!\n" );
break;
}
}
void update(void) //edit information about book
{
clrscr();
int c=0;
int d,e;
printf("****update Books Section****");
char another='y';
while(another=='y')
{
clrscr();
printf("Enter Book Id to be edited:");
scanf("%d",&d);
fp=fopen("mylaibrary.txt","rb+");
while(fread(&a,sizeof(a),1,fp)==1)
{
if(checkid(d)==0)
{
printf("The book is availble");
printf("The Book ID:%d",a.id);
printf("Enter new name:");scanf("%s",a.name);
printf("Enter new Author:");scanf("%s",a.Author);
printf("Enter new quantity:");scanf("%d",&a.quantity);
printf("Enter new price:");scanf("%f",&a.Price);
printf("Enter new rackno:");scanf("%d",&a.rackno);
printf("The record is modified");
fseek(fp,ftell(fp)-sizeof(a),0);
fwrite(&a,sizeof(a),1,fp);
fclose(fp);
c=1;
}
if(c==0)
{
printf("No record found");
}
}
printf("Modify another Record?(Y/N)");
fflush(stdin);
another=getch() ;
}
returnfunction();
}
// C programming Create a system managing a mini library system. Every book corresponds to a...
Subject: Java Program You are writing a simple library checkout system to be used by a librarian. You will need the following classes: Patron - A patron has a first and last name, can borrow a book, return a book, and keeps track of the books they currently have checked out (an array or ArrayList of books). The first and last names can be updated and retrieved. However, a patron can only have up to 3 books checked out at...
In this assignment you will implement software for your local library. The user of the software will be the librarian, who uses your program to issue library cards, check books out to patrons, check books back in, send out overdue notices, and open and close the library. class Calendar We need to deal with the passage of time, so we need to keep track of Java. Declare this variable as private int date within the class itself, not within any...
The CIS Department at Tiny College maintains the Free Access to
Current Technology (FACT) library of e- books. FACT is a collection
of current technology e-books for use by faculty and students.
Agreements with the publishers allow patrons to electronically
check out a book, which gives them exclusive access to the book
online through the FACT website, but only one patron at a time can
have access to a book. A book must have at least one author but can...
write an html file and a JavaScript file to show the due date of a book checked out from a library. The html file should contain necessary elements to work with the JavaScript file described as follow. The JavaScript file needs to meet the following requirements: 1. It needs to have an object called “book” that have attributes called name, title, author and price. The values of these attributes are then written to the html file using JavaScript statements. 2....
You need to program a simple book library system. There are three java classes Book.java // book object class Library.java //library class A2.java //for testing The Book.java class represents book objects which contain the following fields title: a string which represents the book title. author: a string to hold the book author name year: book publication year isbn: a string of 10 numeric numbers. The book class will have also 3 constructors. -The default no argument constructor - A constructor...
Programming Assignment This is a database course using Open Office Database. Assume that you have been given the task of creating a system for a library to keep track of their books, the borrowers of the books, and the books that are currently lent out. Your first step will be to create the relations necessary for this system. Book will need information such as a unique identifier for each book, title, author, ISBN number, date of publication, cost. Borrower will...
This case is a simplified (initial draft) of a new system for the University Library. Of course, the library system must keep track of books. Information is maintained about both book titles and the individual book copies. Book titles maintain information about title, author, publisher, and catalog number. Individual copies maintain copy number, edition, publication year, ISBN, book status (whether it is on the shelf or loaned out), and date due back in. The library also keeps track of patrons...
Design an ER diagram for a library management system. The library manages books, members, and books borrowed by members. The library has several branches around the city. Each branch has a name and address and is identified by a branch ID. Each book in the system is identified by a unique ISBN along with its title, author(s), and publisher. A publisher is identified by its name, address, and phone. Note that publishers may be based anywhere around...
Design an ER diagram for a library management system. The library manages books, members, and books borrowed by members. The library has several branches around the city. Each branch has a name and address and is identified by a branch ID. Each book in the system is identified by a unique ISBN along with its title, author(s), and publisher. A publisher is identified by its name, address, and phone. Note that publishers may be based anywhere around...
IN C++ My project will be a library management system. It will have seven functions. It HAS to contain: classes, structures, pointers and inheritance. fix code according to below 1. Add a new book allows the user to enter in book name and book code Book code has to be in # “Invalid book code” “book name has been added to library” book code will be used to borrow books 2. Add a new user must use first user must...