Question

In: Computer Science

NOTE: This assignment is for the design only Nothing you turn in should look like C/C++...

NOTE: This assignment is for the design only
Nothing you turn in should look like C/C++ code


For this assignment, we are going to design a system to Manage loans from the local public library

For this, we will need the following entities, plus collections for each of the
entities: Patrons, Books, and Loans

The data for a Book will contain at least the following:
Author
Title
ISBN Number
Library ID number
Cost
Current Status (In, Out, Repair, Lost)

You may add other data needed for your implementation as well as you will need accessor and mutator functions for the data.


The data for a Patron will contain at least:
Name (e.g. Fred Smith)
ID number (6 digits e.g. 123456)
Fine Balance
Current # of books out

You may add other data needed for your implementation as well as you will need accessor and mutator functions for the data.


The data for a Loan (The transaction entity) will contain at least the following:

Loan ID
Book ID
Patron ID
Due Date and Time
Current Status (overdue, normal)

You may add other data needed for your implementation as well as you will need accessor and mutator functions for the data.
For the collections of each of the Patrons and Books Classes identified above, you will need to include the ability to:
Add
Edit
delete
Search/Find based on appropriate criteria
Print a list of all entries in the collection
Print the details for a single entity (do a find first)

Other methods you may identify

For Loans you will need:

Check Out a book (update book and patron info as well as add a loan)
Check in a book (check for fines and update patron and book info and delete loan)
List all overdue
List all books for a particular patron
Update loan status based on the system clock
Re-Check a book
Edit a loan
Report lost (update book and charge patron book cost as well)

Other methods you may identify

You will need to verify the following

  1. Before borrowing a book, make sure Patron has no overdue books and that total books out will be <= 6 including new borrow
  2. When checking a book in, determine if fines are owed
  3. Reporting a book as lost records the cost of the book to the patrons fine balance
  4. For Loans Add = Borrow a book
    Delete = Return a book
    Edit = Re-check
  5. Also will need a
    PayFines (in Patrons)
    Report Lost (in Loans but will have to update books and patrons)
    Print a list of overdue books with patron info (in loans but will have to update books and patrons)

You will need to provide an appropriate menu system that can be multi-level if you like.

Do not attempt to provide card catalog services for allowing patrons to search for books. You may assume each book has a unique acquisition number, and you may use these numbers to refer to books borrowed and returned.

You will need to load and store the data. This can be done automatically when the program starts and ends. You should also want to store after an add, delete or edit to make sure changes to the data are preserved.

You can assume the following

Loan period is 10 days with an additional recheck of 10 days (1 recheck only)

A max of 6 books can be out to a single patron at a time

Fine rate is $0.25 per day (24 hour period)

For this design you will need to turn in the following:

A diagram set consisting of:

  1. A title page with your name, assignment, course and title
  2. a single class diagram showing only the relationships between the entities
  3. a set of six individual class diagrams showing the attributes and methods
    for each of the classes in #2
  4. Step by Step pseudo code algorithms for every method defined in every class in
    the diagram from #2. You do not need to provide pseudo code for simple accessor and mutator functions (i.e. sets and gets)
  5. A 1-2 paragraph report about your design experience.

All of these items should be gathered together, in order, in a single PDF file.

NOTE: This assignment is for the design only
Nothing you turn in should look like C/C++ code

Solutions

Expert Solution

SINGLE CLASS DIAGRAM SHOWING RELATION BETWEEN THE ENTITIES.

SET OF INDIVIDUAL CLASS DIAGRAM.

  • Book entity attributes.2. Patron entity attributes3. Loan entity attributes4. Book entity methods.5. Patron entity methods.6. Loan entity methods(Pseudo code for all the methods.)

Pseudo code for Add_book

1. get library id number for the book.
2. Insert into table_books values(Book_ID,author,title,ISBN_number,Library_ID_number,Cost,current_status)
3. Response - Book successfully added.

Pseudo code for Edit_book

1. Update into table_books values(author,title,ISBN_number,Library_ID_number,Cost,current_status) where Book_ID = "+id+"
2. Response - Book updated successfully.

Pseudo code for Delete_book

1. delete from table_books where Book_ID = "+id+"
2. Response = Book deleted successfully.

Pseudo code for search_for_books

1. select from table_books where Book_ID = "+id+"
2. Response = Book fetched successfully.

Pseudo code for get_all_books

1. select * from table_books;
2. Response = All books fetched successfully

Pseudo code for get_book_info

1. select from table_books values(author,title,ISBN_number,Library_ID_number,Cost,current_status) where Book_ID = "+id+"
2. data = database_query_result
3. response - data, Book information fetched successfully.

Pseudo code for Add_patron

1. Insert into table_patrons values(Patron_Id,Name,ID_Number,Fine_balance,borrowed_books)
2. Response - Patron successfully added.

Pseudo code for Edit_book

1. Update into table_patrons values(Patron_Id,Name,ID_Number,Fine_balance,borrowed_books) where Patron_ID = "+id+"
2. Response - Patron updated successfully.

Pseudo code for Delete_patron

1. delete from table_patrons where Patron_ID = "+id+"
2. Response = Patron deleted successfully.

Pseudo code for search_for_patrons

1. select from table_patrons where Patron_ID = "+id+"
2. Response = Patron fetched successfully.

Pseudo code for get_all_patrons

1. select * from table_patrons;
2. Response = All patrons fetched successfully

Pseudo code for get_patron_info

1. select from table_patrons values(Patron_Id,Name,ID_Number,Fine_balance,borrowed_books) where Patron_ID = "+id+"
2. data = database_query_result
3. response - data, Book information fetched successfully.

Pseudo code for checkout_book

1. before checkout check borrowed_books <= 6 and Patron_ID not in list_of_overdue_books.
2. add Book_ID,Patron_ID to the table_loans.
3. add Loan_ID into table_loans.
4. change current_status for Book_ID to borrowed.

Pseudo code for checkin_book

1. before check_in check fine_balance for Patron_ID = 0
2. change current_status for Book_ID to not_borrowed.

Pseudo code for list_of_overdue_books

1. left_join table_books and table_loans on borrowed_books and overdue_datetime.
2. select borrowed_books from tbl_books where overdue_datetime > 10.
3. left_join table_patrons and table_books on Patron_ID and Book_ID
4. select Patron_ID from tbl_patrons where Book_ID = "+id+".

Pseudo code for report_lost_book

1. set report_lost_book field in loans to true.
2. for Patron_ID in table_patrons set book_lost_patron = true.
3. for Book_ID in table_books set book_is_lost = true.
4. for Patron_ID in table_patrons set fine_balance = new_fine_balance.
5. for Patron_ID in table_patrons set fine_paid = true.

Paragraph for design experience.

The library loan design is a system which requires managed databases and admin system to keep track of the books, patrons and loans.

The entities were easy to design but to establish the relation between those entities was the tricky part. I had to also keep in mind the constraints such as fine and overdue datatime and lost books and had to update all the other tables when an event such as this occurred.

But I had a great experience in designing these system and gave my best efforts to make the design optimal.


Related Solutions

If you look on Twitter or turn the news on you will undoubtedly see or hear...
If you look on Twitter or turn the news on you will undoubtedly see or hear someone discussing the unemployment numbers. Unemployment has been deemed as bad and should be reduced as much as possible. However, there are aspects of unemployment that are indeed good. As you see in the text, full employment will never be 0%. Please discuss why unemployment can be good for the economy and why it is healthy for the economy to have some level of...
The code should be written in c++. It should be in only OpenGL // ***** ONLY...
The code should be written in c++. It should be in only OpenGL // ***** ONLY OpenGL PLEASE ******// write a program snippet that accepts the coordinates of the vertices of a rectangle centered around the origin, with edges that are parallel to the X and Y axes, and with aspect ratio W and converts it into a rectangle centered around the origin with aspect ratio of 1/W. The program has to figure W from the given points. You MUST...
Should all industries have to compete globally? This is a read only assignment for you to...
Should all industries have to compete globally? This is a read only assignment for you to review before posting your discussion in unit 4. When the first Japanese cars arrived on the West Coast in the 1970s, no one saw them as a threat to U.S. jobs. Although they were cheaper and more fuel-efficient than U.S.-made cars, most Americans could not be bothered; with gasoline at 30 cents a gallon, the difference in cost between a car that got 30...
REVERSE POLISH CALCULATOR C++ ONLY. For this assignment, you are to write a program, which will...
REVERSE POLISH CALCULATOR C++ ONLY. For this assignment, you are to write a program, which will calculate the results of Reverse Polish expressions that are provided by the user. You must use a linked list to maintain the stack for this program (NO array implementations of the stack). You must handle the following situations (errors): Too many operators (+ - / *) Too many operands (doubles) Division by zero The program will take in a Polish expression that separates the...
what should the indifference curve between income and crime look like?
what should the indifference curve between income and crime look like?
This assignment will ask you to look at your own finances. For this assignment, write a...
This assignment will ask you to look at your own finances. For this assignment, write a paragraph showing your percentages. I DO NOT want to know how much money you spend or have as income, I am only looking at the percentages. Describe for me what the effect of inflation is on you personally given what you found out. Look at a typical month of your expenditures and income. Create a list of your expenses by category (see below). Create...
Note: This is a single file C++ project - No documentation is required on this assignment....
Note: This is a single file C++ project - No documentation is required on this assignment. Write a Fraction class whose objects will represent Fractions. Note: You should not simplify (reduce) fractions, you should not use "const," and all of your code should be in a single file. In this single file, the class declaration will come first, followed by the definitions of the class member functions, followed by the client program. You must provide the following member functions: A...
ASSIGNMENT: A CRITIQUE OF THE DELIVERY OF HOLISTIC SUSTAINABILITY IN ELECTRICAL SYSTEM DESIGN PLEASE note a...
ASSIGNMENT: A CRITIQUE OF THE DELIVERY OF HOLISTIC SUSTAINABILITY IN ELECTRICAL SYSTEM DESIGN PLEASE note a key phrase in the brief is: It is important that the student takes the perspective of their prospective profession in this assignment. They should consider to what extent their chosen profession can or cannot influence the delivery of holistic sustainable solutions. Some aspects may be beyond the profession’s control, others within its sphere of influence. The barriers to delivery of holistic sustainability solution in...
Java Programming For this assignment, you should modify only the User.java file. Make sure that the...
Java Programming For this assignment, you should modify only the User.java file. Make sure that the InsufficientFundsException.java file is in the same folder as your User.java File. To test this program you will need to create your own "main" function which can import the User, create an instance and call its methods. One of the methods will throw an exception in a particular circumstance. This is a good reference for how throwing exceptions works in java. I would encourage you...
You like both apples and pears, and you consume nothing but apples and pears. The consumption...
You like both apples and pears, and you consume nothing but apples and pears. The consumption bundle where you consume xA bushels of apples and xB bushels of pears is written as (xA; xB). You are indi§erent between (10; 0) and the set and the set of consumption bundles that satisÖes xB = 10 x . (a) (2 POINTS) List 3 consumption bundles that are on the indi§erence curve for (10; 0). (b) (2 POINTS) What is your marginal rate...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT