Q2. Book Donation App You are required to develop a Book Donation App that allows people to donate books. The book donation system should have the following classes a) Book – bookId, title, author, imageUrl, donorId, status DonorId property is should hold , the ID of the person who donated the book. Note that the status attribute can have one of the following values: - pending : As soon as the user adds a donated book to the system, the status is set to pending. - available : When the book donor delivered the book to the store then status of the book can be changed to available. b) Donor - donorId, firstname , lastname , phone, street, city, email, password c) BookCatalog – contains list of books and a list of donors. Also the class contains the following methods addBook(book) Adds a book to the list of books (the status of newly added boom should be set to pending). updateBook(book) Updates the book having the matching bookId. deleteBook(bookId) Deletes the book from the list of books. getBooks(status=available) Returns the books by status. By default, only available books should be return. getDonorBooks(donorId) Returns the books donated by a particular donor. getTopDonors(topCount) Returns the top book donors. Eg. If the user passes 3 as topCount parameter, then this function returns the top 3 donors and the list of books each one has donated. addDonor Add new donor to the list of donors updateDonor(donorId) allow the user to update the donor details deleteDonor(donorId) You can delete a donor, if they are not associated with any book Test your code by creating app.js file to instantiate the BookCatalog class and test its methods. Note that you should make use of the JavaScript features and capabilities such as arrow functions, array functions (.map, .reduce, .filter, .splice, .sort…), spread operator, object literals, and classes.

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter7: File Handling And Applications
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

****using javascript****

Q2. Book Donation App
You are required to develop a Book Donation App that allows people to donate books.
The book donation system should have the following classes
a) Book – bookId, title, author, imageUrl, donorId, status
DonorId property is should hold , the ID of the person who donated the book.
Note that the status attribute can have one of the following values:
- pending : As soon as the user adds a donated book to the system, the status is set
to pending.
- available : When the book donor delivered the book to the store then status of the
book can be changed to available.
b) Donor - donorId, firstname , lastname , phone, street, city, email, password
c) BookCatalog – contains list of books and a list of donors. Also the class contains the
following methods
addBook(book) Adds a book to the list of books (the status of newly added
boom should be set to pending).
updateBook(book) Updates the book having the matching bookId.
deleteBook(bookId) Deletes the book from the list of books.
getBooks(status=available) Returns the books by status. By default, only available books
should be return.
getDonorBooks(donorId) Returns the books donated by a particular donor.
getTopDonors(topCount) Returns the top book donors. Eg. If the user passes 3 as
topCount parameter, then this function returns the top 3 donors
and the list of books each one has donated.
addDonor Add new donor to the list of donors
updateDonor(donorId) allow the user to update the donor details
deleteDonor(donorId) You can delete a donor, if they are not associated with any
book
Test your code by creating app.js file to instantiate the BookCatalog class and test its methods.
Note that you should make use of the JavaScript features and capabilities such as arrow
functions, array functions (.map, .reduce, .filter, .splice, .sort…), spread operator, object
literals, and classes. 

 

Q2. Book Donation App
You are required to develop a Book Donation App that allows people to donate books.
The book donation system should have the following classes
a) Book – bookld, title, author, imageUrl, donorld, status
Donorld property is should hold , the ID of the person who donated the book.
Note that the status attribute can have one of the following values:
- pending : As soon as the user adds a donated book to the system, the status is set
to pending.
- available : When the book donor delivered the book to the store then status of the
book can be changed to available.
b) Donor - donorld, firstname , lastname , phone, street, city, email, password
c) BookCatalog – contains list of books and a list of donors. Also the class contains the
following methods
addBook(book)
Adds a book to the list of books (the status of newly added
boom should be set to pending).
updateBook(book)
deleteBook(bookld)
Updates the book having the matching bookId.
Deletes the book from the list of books.
getBooks(status=available) Returns the books by status. By default, only available books
should be return.
getDonorBooks(donorId) Returns the books donated by a particular donor.
getTopDonors(topCount) Returns the top book donors. Eg. If the user passes 3 as
topCount parameter, then this function returns the top 3 donors
and the list of books each one has donated.
addDonor
Add new donor to the list of donors
updateDonor(donorId)
allow the user to update the donor details
deleteDonor(donorId)
You can delete a donor, if they are not associated with any
book
Test your code by creating app.js file to instantiate the BookCatalog class and test its methods.
Note that you should make use of the JavaScript features and capabilities such as arrow
functions, array functions (.map, .reduce, .filter, .splice, .sort...), spread operator, object
literals, and classes.
Transcribed Image Text:Q2. Book Donation App You are required to develop a Book Donation App that allows people to donate books. The book donation system should have the following classes a) Book – bookld, title, author, imageUrl, donorld, status Donorld property is should hold , the ID of the person who donated the book. Note that the status attribute can have one of the following values: - pending : As soon as the user adds a donated book to the system, the status is set to pending. - available : When the book donor delivered the book to the store then status of the book can be changed to available. b) Donor - donorld, firstname , lastname , phone, street, city, email, password c) BookCatalog – contains list of books and a list of donors. Also the class contains the following methods addBook(book) Adds a book to the list of books (the status of newly added boom should be set to pending). updateBook(book) deleteBook(bookld) Updates the book having the matching bookId. Deletes the book from the list of books. getBooks(status=available) Returns the books by status. By default, only available books should be return. getDonorBooks(donorId) Returns the books donated by a particular donor. getTopDonors(topCount) Returns the top book donors. Eg. If the user passes 3 as topCount parameter, then this function returns the top 3 donors and the list of books each one has donated. addDonor Add new donor to the list of donors updateDonor(donorId) allow the user to update the donor details deleteDonor(donorId) You can delete a donor, if they are not associated with any book Test your code by creating app.js file to instantiate the BookCatalog class and test its methods. Note that you should make use of the JavaScript features and capabilities such as arrow functions, array functions (.map, .reduce, .filter, .splice, .sort...), spread operator, object literals, and classes.
Expert Solution
steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Running Time of Application
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Microsoft Visual C#
Microsoft Visual C#
Computer Science
ISBN:
9781337102100
Author:
Joyce, Farrell.
Publisher:
Cengage Learning,