Instructions for Final ProjectWe are going to create a Library System as part of the final project.The Library has books that are written by authors (who are people). The Library has patrons (who...

I attached a file


Instructions for Final Project We are going to create a Library System as part of the final project. The Library has books that are written by authors (who are people). The Library has patrons (who are people) who can rent books. We will create classes - book, author, rental, patron Author will have a list of Books. Patron will have a rental cart with a list of Rentals. Author and Patron will inherit from Person class. We will implement this in 2 parts. Part 1 Create Book class. Auto-implemented properties i. ISBN (text) ii. Title (text) iii. AuthorInfo (Author) iv. PublishedOn(date) v. PublishedBy(text) Constructors · Create a constructor that takes ISBN, Title and AuthorInfo. · It sets PublishedOn to current date and PublishedBy to Unknown · Create a constructor that takes ISBN, Title, AuthorInfo, PublishedOn and PublishedBy Note: When using multiple constructors, use “constructor chaining” Methods Display() · Method takes no arguments · Method displays book info. See sample below: Book 'Harry Potter Book 1' was written by Joanne Rowling and published on 1/1/1997 Create Author class and inherit from Person. Create the following properties i. Books will hold a list of “Book” object (declare as private) Constructors i. Use the same as person class and call the base Methods DisplayInfo · Method will not take parameters · Method will not return a value · Method will display the firstname, lastname and email DisplayBooks · Method will not take parameters · Method will not return a value · Method will loop through the Books list using foreach and call the Display method of Book class AddBook · Method takes 1 parameter of type Book · Method will add the book to the Books list · Method will set the book’s AuthorInfo (firstname and lastname) to the author’s firstname and lastname RemoveBook · Method takes 1 parameter of type text (ISBN) · Method will find the book using the Find method (matching the ISBN to the book’s ISBN) · Then Method will Remove the book from the List. Write tests for the following: 1. Create 2 authors (without creating books inside Authors) · Call DisplayInfo for Author 1 · Call DisplayInfo for Author 2 2. Create 6 books · Use first constructor for the first 3 and second constructor for the other 3 books · Books 1,3,5 should be set to have AuthorInfo as Author 1 · Books 2,4,6 should be set to have AuthorInfo as Author 2 3. Connecting Books to Author · Add books 1, 3, 5 to Author 1 · Display books of Author 1 · Add books 2,4,6 to Author 2 · Display books of Author 2 · Remove book #1 from Author #1 · Display books of Author 1 Part 2 Create Rental class • #### Properties · Book (Book object) · DateRented (Date) · DateDue (Date) Constructor · One constructor that takes 3 parameters Methods · None Create Patron class and inherit from Person Auto Implemented properties · LibraryId (String) · StartDate (Date) · EndDate (Date) · IsAccountActive (True/False) · RentalCart (List of Rental objects) · FineAmountDue (number) Constructor · One constructor that takes first name, last name and id · Inside the constructor Set FineAmountDue to 0 Set StartDate to Today’s date Set IsAccountActive to true (Hint) Any time you inherit, call the base class constructor Methods Display() Method does not take any parameter Method does not return any value Displays a message (See example below) Patron Id=1111 Name=Tim Smith AddToRentalCart() Method takes a book object and due date as input Method does not return a value Creates a new Rental object for the Book (input) and adds to the RentalCart list. Method also displays a message (see example below) Added to rental cart Harry Potter Book 1 for Patron TimSmith RemoveFromRentalCart() Method takes a book object as input Method does not return a value Method also displays a message (see example below) Removed from rental cart Harry Potter Book 2 for Patron TimSmith Test the following in main.cs · Create 5 patrons · Add book 1 to Patron 1’s rentalcart by calling the · AddToRentalCart method · Remove book 3 from Patron 1’s rentalcart by calling the RemoveFromRentalCart method • Display patron info
Dec 03, 2022
SOLUTION.PDF

Get Answer To This Question

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here