Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

1. Create a Library Collection class . Properties o PatronList (private, List of Patron object) o BookList (List of Book object) Constructor o No need

1. Create a Library Collection class . Properties o PatronList (private, List of Patron object) o BookList (List of Book object) Constructor o No need as there will be a default constructor created by c# automatically Methods o AddPatron Method takes a Patron object as input Method does not return a value Add patron the the PatronList Display a message Added successfully Tim Smith o Remove Patron Method takes a Patron object as input Method does not return a value Find the matching patron and remove it from Patron List Removed successfully Joanna Carrier o DisplayPatronInfo Method does not take any parameter Method does not return any value Loop through PatronList one by one and display each patron by calling Patron class's Display method o AddToCollection Method takes a Book object as input Method does not return a value Add the book to the the BookList Display a message Added book successfully! RemoveFromCollection Method takes a Book object as input Method does not return a value Find the matching book and remove it from Book List Display a message Removed book successfully! . o . . . o Display Collection Method takes no parameters Method does not return a value Loop through each book in Book List and display each book by calling the Display method of the book object o ProcessRental Method will take a patron object as input Method will not return a value Loop through the rentalcart of the patron Then remove each book that is present in the rentalcart from the Booklist (Once it is rented it should not be part of the collection) Display a message for each book Processed rental for Harry Potter Book 1 Processed rental for Five Kingdoms Book 4 o ProcessReturns Method will take a patron object and a book object as input Method will not return a value Find the book in the rentalcart of the patron. Check the due date of the book. If it is earlier than today's date, add $10 to the FineAmountDue. Show a message that there is a fine of $10. Remove the book from the rental cart of the patron. Add the book back to the LibraryCollection's booklist. Display a message for each book Processed rental for Harry Potter Book 1 In main.cs test the following: Create a librarycollection object. Add the 5 patrons to this librarycollection by calling AddPatron() method Display the librarycollection's patron information by calling DisplayPatronInfo() method Remove the 5th patron from the librarycollection by calling RemovePatron() method Display the librarycollection's patron information by calling DisplayPatronInfo() method . . . List of Patrons of the Library: Patron Id=1111 Name=Tim Smith Patron Id=2222 Name=Jill Smith Patron Id=3333 Name=Tom Sawyer Patron Id=4444 Name=Harry Hawkins Patron Id=5555 Name=Joanna Carrier Removed successfully Joanna Carrier List of Patrons of the Library: Patron Id=4444 Name=Harry Hawkins In main.cs test the following: Add the 6 books to the library collection by calling the AddToCollection() method Display the librarycollection's patron information by calling Display Collection() method Remove the 5th book from the librarycollection by calling RemoveFromCollection() method Display the librarycollection's patron information by calling DisplayCollection() method Sample data (I only added 5 books) . List of Books in the Library's Collection: Book 'Harry Potter Book 1' was written by Joanne Rowling and published on 1/1/1997 Book 'Harry Potter Book 2' was written by Joanne Rowling and published on 1/1/2001 Book 'Harry Potter Book 3' was written by JoanneRowling and published on 1/1/2010 Book \"Five Kingdoms Book 4 was written by BrandonMull and published on 1/1/2011 Book \"Five Kingdoms Book 5' was written by BrandonMull and published on 1/1/2012 Removed book successfully! List of Books in the Library's Collection: Book \"Harry Potter Book 1' was written by JoanneRowling and published on 1/1/1997 Book 'Harry Potter Book 2' was written by Joanne Rowling and published on 1/1/2001 Book \"Harry Potter Book 3' was written by JoanneRowling and published on 1/1/2010 Book 'Five Kingdoms Book 4' was written by BrandonMull and published on 1/1/2011 In main.cs . . Add book 1 to Patron 1's rentalcart by calling the AddToRentalCart method Add book 2 to Patron 1's rentalcart by calling the AddToRentalCart method Add book 3 to Patron 1's rentalcart by calling the AddToRentalCart method Remove book 3 from Patron 1's rentalcart by calling the RemoveFromRentalCart method Process the rental by calling the library collection's ProcessRental method. Display the library collection after the rental by calling DisplayCollection() method Added to rental cart Harry Potter Book 1 for Patron TimSmith Added to rental cart Harry Potter Book 2 for Patron TimSmith Added to rental cart Five Kingdoms Book 4 for Patron TimSmith Removed from rental cart Harry Potter Book 2 for Patron TimSmith Processed rental for Harry Potter Book 1 Processed rental for Five Kingdoms Book 4 Return book 2 for Patron 1 by calling the ProcessReturns method Display the library collection after the returns by calling DisplayColelction method

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Introduction to Wireless and Mobile Systems

Authors: Dharma P. Agrawal, Qing An Zeng

4th edition

1305087135, 978-1305087132, 9781305259621, 1305259629, 9781305537910 , 978-130508713

More Books

Students also viewed these Programming questions

Question

What are the advantages of a LAN?

Answered: 1 week ago