Question

Implement a C++ program to develop a simple Library. Library contains pile of books and each...

Implement a C++ program to develop a simple Library. Library contains pile of books and each book comprises of ISBN (cannot be changed), Name, Author Name, Publisher Name, Issue Date, Return Date. [using Structures]

Homework Answers

Answer #1

In C++ a structure is a collection of different data type variables refered under a single name. it is very much similar to a class but it cannot hold the associated functions of the elements/data members in the block so given next to this explaination of structures is the code asked in the question.so its a very basic library system in which you can add a book by using insert function.

#include<iostream.h>
#include<conio.h>

struct book{
   char name[50];
   int ISBN;
   char authorname[50];
   char publishername[50];
   int issuedate;
   int issuemonth;
   int issueyear;
   int retdate;
   int retmonth;
   int retyear;
   struct book *next=NULL;
}

void insert(struct book *head){
    if *head.next==NULL{
       struct book node;
       cout<<"enter the name of book";
 
       gets(node.name)
       cout<<"enter the author name of book";
       gets(node.authorname)
       cout<<"enter the publisher name of book";
       gets(node.publishername)
       cout<<"enter isbn no.";
       cin>>node.ISBN;
       cout<<"enter the issue date month and year";
       cin>>node.issuedate;
       cin>>node.issuemonth;
       cin>>node.issueyear;
       cout<<"enter the return date month and year";
       cin>>node.retdate;
       cin>>node.retmonth;
       cin>>node.retyear;
       *head.next=&node;
    }
   else{
       insert(*head.next);
}
}
void main(){

//the pile of the books will be stored in a linked list where ISBN no. can be a searching key 
struct book library;//first book in library

insert(library);//inserting a book in library
insert(library);//inserting a book in library
getch();
}

*this code may or may not contain bugs.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Using node.js create a system that includes a "library" of books and information about the books,...
Using node.js create a system that includes a "library" of books and information about the books, such as title, a description, author, publisher, ISBN. Include, at least, 12 books in the "library". Now create two people who like books and use the "Shared State" concept to demonstrate what each person's (you and another one) favorite book is. What to turn in: 1. All code and related files (as created via the IDE, so I can run it), compressed using zip....
Write a 4-6 sentence summary explaining how you can use STL templates to create real world...
Write a 4-6 sentence summary explaining how you can use STL templates to create real world applications. In your summary, provide an example of a software project that you can create using STL templates and provide a brief explanation of the STL templates you will use to create this project. After that you will implement the software project you described . Your application must be a unique project and must incorporate the use of an STL container and/or iterator and...
You have to create a Library Borrowing System based on the following requirements: When new books...
You have to create a Library Borrowing System based on the following requirements: When new books arrive, these books must be cataloged into the system by a librarian (i.e., entered in the system). Information on a book should include book ID, title, author ID, ISBN, and edition. The system should capture author names so that users can search for an author. The library may carry multiple books by the same author, and an author can have multiple books in the...
Consider the following relational schema: Author (first_name, last_name, address) Book (title, copyright, first_name, last_name) Edition (isbn,...
Consider the following relational schema: Author (first_name, last_name, address) Book (title, copyright, first_name, last_name) Edition (isbn, pub_date, list_price, publisher, title, copyright) Bookstore (name, address) Stock (store_name, store_price, isbn) - The Author relation gives the author's first name, last name and address. Each (first_name-last_name) pair is unique. - The Book relation gives the title, copyright date, and the first and last names of the author. A book can have only one author however, an author can write more than one book....
University library management system This case is a simplified (initial draft) of a new system for...
University library management system 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...
c++ program to implement a simple program that verifies whether an expression contains balanced braces
c++ program to implement a simple program that verifies whether an expression contains balanced braces
Book(bookID, ISBN, title, author, publish-year, category) Member(memberID, lastname, firstname, address, phone-number, limit) CurrentLoan(memberID, bookID, loan-date, due-date)...
Book(bookID, ISBN, title, author, publish-year, category) Member(memberID, lastname, firstname, address, phone-number, limit) CurrentLoan(memberID, bookID, loan-date, due-date) History(memberID, bookID, loan-date, return-date) Members can borrow books from the library. The number of books they can borrow is limited by the “limit” field of the Member relation. The category of a book includes fiction, non-fiction, children’s and reference. The CurrentLoan table represents the information about books that are currently checked out. When the book is returned to the library, the record will be...
Need in Java coding Write a program that will allow users to enter different types of...
Need in Java coding Write a program that will allow users to enter different types of books into the program, and at the end print out everything that the user entered. Allow the user to enter as many books as they want. Please collect the following information and break down the classes as follows using inheritance/classes. I have added the extra properties that each class should include. Book types: Paper Book (nothing extra) Comic Book (issue number) Magazine (publisher, issue...
Given the following relations about students borrow books from a university library. Student (StudentID: integer, Name:...
Given the following relations about students borrow books from a university library. Student (StudentID: integer, Name: string, EnrollDate: date) Book(Title: string, Author: string, Quantity: integer) BorrowRecord(StudentID: integer, BookTitle: string, BookAuthor: string, BorrowDate: date, DueDate: date, Returned: integer) Note that there are no duplicate records in the three relations, and there can be duplicates of book titles. For Returned, 0 means not returned and 1 indicates the books have been returned. Write the following queries in SQL. (a) Find the StudentIDs...
Plot a UML diagram for the following application. A chain of community libraries run book loan...
Plot a UML diagram for the following application. A chain of community libraries run book loan services. A book can be borrowed from a library of the chain and returned to another library. A book has an ISBN number, a title, some authors, and a year of publication. Books have a loan period limit which is determined by how frequent the books have been borrowed. Books may have multiple copies and each copy has an item number. When all copies...