Question: Write a program to manage a Book Catalog. The catalog would contain a collection of books, with following fields of information: book code (unique for

Write a program to manage a Book Catalog. The catalog would contain a collection of books, with following fields of information: book code (unique for each book; must be valid see ISBN validation rules in this assignment for more info), authors last name, authors first name, book title, year of publication and price. The book catalog should use a file for storing books. The information in the file uses tabs to separate each of the field of a book, with one book per line. Refer to sample file: booklist.txt for more details.

1. At the start, the program should load the catalog from file (Books.txt from current directory), if it doesnt exist, create a new catalog.

2. The program should allow the user to add a new book to the catalog. The program should ask for the required information and then add the book to the catalog, only if same book code doesnt already exist in the catalog and if the book is a valid. Book is considered valid, if the book code is valid, name and title are valid (name cant start with numbers, name/title cant be empty, price is not negative or zero, year cannot be greater than 2013)

3. The program should allow user to find a book in the catalog, given one of the following: author first name or last name or the book code. If the book is found, all the information about the book should be displayed. If the book is not found, an appropriate message should be displayed.

4. The program should allow user to delete an existing book from the catalog.

5. The driver (or client) program should have a menu driven interface (console) to allow users to select one of the options to perform the above tasks and repeat them till the program is exited. The program should display appropriate messages to the user for each operation, successful or not.

6. When exiting, the program should ask to save Yes/No the book catalog to file, taking in to account any of the above changes, for future reuse.

Design/Implementation Requirements:

1. Book Class represents one book. In addition to accessor (get) and mutator (set) methods for instance variables, this class should not allow instantiation of book objects unless the initialization values are valid including book code. This class also should override the toString method.

2. BookCatalog Class represents a collection of books. The data structure used for storing books should be a linked list of books. You are required to implement this linked list structure yourself and NOT use any Java API collection, Arrays and Collections types. This class should override toString method and provide methods for all book catalog operations as specified by the usage requirements.

3. BookCatalogClient Class This class contains the main method. The above classes should be I/O independent to be utilized by console, applet, file based applications. Therefore, for this program, the file save and load operations are implemented by the client class.

Book code validation rules: An ISBN (International Standard Book Number) identifies a unique publication. An ISBN is ten digits. The first nine digits must be decimal digits (0...9). The tenth digit can be either a decimal digit or the letter X. Three single dashes may be between any of the characters. (i.e., an ISBN number may either have no dashes or exactly three dashes). Also, an ISBN must not begin or end with a dash, and sequential dashes are not allowed. Some valid example ISBNs: 0-201-88337-6 0-13-117334-0 0821211315 (no dashes is ok) 1-57231-866-X The last character of an ISBN number is a checksum. The checksum is determined from the first 9 digits; it is computed by taking modulo 11 (the remainder after dividing by 11) of the sum of each digit multiplied by its position in the ISBN. The letter X corresponds to a value of 10. Here are two ISBNs and the calculations that show how the check sum is determined: 0-201-88337-6:(0*1 + 2*2 + 0*3 + 1*4 + 8*5 + 8*6 + 3*7 + 3*8 + 7*9)mod 11=6 1-57231-866-X:(1*1 + 5*2 + 7*3 + 2*4 + 3*5 + 1*6 + 8*7 + 6*8 + 6*9)mod 11=10(X) For more info, check out: www.isbn.org. Some invalid ISBNs: 0-201-8A337-6 (bad digit) 0-201-88337-63 (too many digits) 0-201-88-337-6 (too many dashes) 0-201883376 (not enough dashes) 0-201-88337-3 (wrong check sum) -013-117334-0 (beginning or ending dash) 157231--866-X (sequential dashes) 013-1134-0 (too few digits)

JAVA

JAVA

JAVA

booklist.txt:

0-387-95206-3 Misra Pady A Discipline of Multiprogramming 2001 45.50 1-85233-384-7 Tao Lewis Adaptive Control of Nonsmooth Dynamic Systems 2001 65.00 3-540-67713-5 Kloss Ray Advertising Worldwide 2001 35.00 0-387-94937-2 Campbell Norman An Introduction to Environmental Biophysics 1998 31.50 1-85233-219-0 Jaulin Kieffer Applied Interval Analysis 2001 55.00 3-540-65367-8 Vazirani Gordy Approximation Algorithms 2001 24.50 3-540-66334-7 Faber Finn Biotransformations in Organic Chemistry 2000 23.00 3-540-66574-9 Kapitaniak Kelly Chaos for Engineers 2000 23.00 3-540-65620-0 Berg Clive Computational Geometry 2000 23.00 3-540-42074-6 Ferziger Peric Computational Methods for Fluid Dynamics 2002 35.00 3-540-67481-0 Mueller Paul Computer Architecture 2000 35.00 3-540-42243-9 Vob Daduna Computer-Aided Scheduling of Public Transport 2001 45.00 3-540-41820-2 Leonhard Leonis Control of Electrical Drives 2001 42.00 3-540-41613-7 Omicini Mirche Coordination of Internet Agents 2001 32.00 3-540-41377-4 Muther Morgan Customer Relationship Management 2002 28.00 3-540-41247-6 Grellmann Seidler Deformation and Fracture Behaviour of Polymers 2001 70.00 1-85233-397-9 Vlietstra Rony Dictionary of Acronyms and Technical Abbreviations 2001 49.50 3-540-41341-3 Meyer Baese Digital Signal Processing with Field Programmable Gate Arrays 2001 52.50 0-387-95065-6 Sarjoughian Cellier Discrete Event Modeling and Simulation Technologies 2001 52.50 3-540-41817-2 Gusev Rempel Disorder and Order in Strongly Nonstoichiometric Compounds 2001 70.00 0-387-95192-X Coutinho Kumari Dynamic Simulations of Multibody Systems 2001 52.50 0-387-95144-X Hummel Craig Electronic Properties of Materials 2001 52.50

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!