cs201_hw2 - CS 201, Fall 2010 Homework Assignment 2 Due:...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: CS 201, Fall 2010 Homework Assignment 2 Due: 18:00, November 22, 2010 In this homework, you will implement a library system. The library system will maintain a collection of books for the library. The students will be able to check out books from the library and will be able to return them to the library. The library system will have the following functionalities; the details of these functionalities are given below: 1. Add a book 2. Delete a book 3. Add a student 4. Delete a student 5. Check out a book by a student 6. Return a book 7. Show the list of all books 8. Show detailed information about a particular book 9. Show detailed information about a particular student Add a book: The library system will allow to add a new book to its collection with the following information: book id, book title, authors, and the year it was published. The book ids must be unique positive integers. Hence, the system should check whether or not the specified book id already exists (i.e., whether or not it is the id of another book), and if the book exists, it should not allow the operation and display a warning message. Delete a book: The library system will allow to delete an existing book specified with its book id. If the book does not exist (i.e., if there is no book with the specified id), the system should display a warning message. Note that it should be possible to delete books which are checked out. Add a student: The library system will allow to add a new student with the following information: student id and name. The student ids must be unique positive integers. Therefore, the system should check whether or not the specified student id already exists (i.e., whether or not it is the id of another student), and if the student exists, it should not allow the operation and display a warning message. Delete a student: The library system will allow to delete an existing student with student id. If the student does not exist (i.e., if there is no student with the specified id), the system should display a warning message. If the student has checked out books, those books must be returned to the system as part of the delete operation for the student. Checkout a book by a student: The library system will allow to check out a particular book by a particular student. For that, the book id and the student id have to be specified. The system should first check whether or not this book exists; if it does not, it should not allow the operation and display a warning message. The system should also check whether or not this student exists; if he/she does not, it should not allow the operation and display a warning message. If both the book and the student exist and the book is not already checked out, the check out operation must be performed. Note that a book can be checked out by only one student. However, a student can check out multiple books....
View Full Document

Page1 / 6

cs201_hw2 - CS 201, Fall 2010 Homework Assignment 2 Due:...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online