Question: all I need is to modify the module and get the exact output github link is here , only part 5 is needed https://github.com/Seneca-244200/OOP-Project#:~:text=Back%20to%20milestones-,Milestone%205,-The%20Seneca%20Library only

all I need is to modify the module and get the exact output github link is here , only part 5 is needed https://github.com/Seneca-244200/OOP-Project#:~:text=Back%20to%20milestones-,Milestone%205,-The%20Seneca%20Library only

Publication* getPub(int libRef) method 

and after is needed ========================= Publication* getPub(int libRef) method

Create a method to return the address of a Publication object in the PPA that has the library reference number matching the "libRef" argument. the newPublication() method

If the NOLP is equal to the SDDS_LIBRARY_CAPACITY, print: "Library is at its maximum capacity!" and exit.

Otherwise,

print: "Adding new publication to the library"

  • get the publication type from the user.
  • in a publication pointer, instantiate a dynamic "Publication" or "Book" based on the user's choice.
  • Read the instantiated object from the cin object.
  • If the cin fails, flush the keyboard, print "Aborted!" and exit.
  • If the cin is ok, then confirm that the user wants to add the publication to the library using this prompt: "Add this publication to the library?". If the user did not confirm, print "Aborted!" and exit.
  • After the user confirms, if the publication object is valid
    • Add one to the LLRN and set the library reference number to the value
    • Add the publication object's address to the end of the PPA and add one to the NOLP.
    • set the "changed" flag to true
    • print: "Publication added"
  • If the publication object is not valid print: "Failed to add publication!" and delete the allocated memory.

Adding a new publication to the library:

Seneca Library Application 1- Add New Publication 2- Remove Publication 3- Checkout publication from library 4- Return publication to library 0- Exit > 1 Adding new publication to the library Choose the type of publication: 1- Book 2- Publication 0- Exit > 2 Shelf No: S001 Title: Seneca Student Handbook Date: 2022/1/5 Add this publication to the library? 1- Yes 0- Exit > 1 Publication added 

The removePublication Method

  • print: "Removing publication from the library"
  • Search all the publications
  • If the user selects a publication and confirms to remove the publication using the prompt: "Remove this publication from the library?"
    • Set the library reference of the selected publication to 0 (zero)
    • set the "changed" flag to true
    • print: "Publication removed"

removing a publication from the library

Seneca Library Application 1- Add New Publication 2- Remove Publication 3- Checkout publication from library 4- Return publication to library 0- Exit > 2 Removing publication from the library Choose the type of publication: 1- Book 2- Publication 0- Exit > 2 Publication Title: Sen Select one of the following found matches: Row |LocID | Title |Mem ID | Date | Author | ------+------+--------------------------------+-------+------------+-----------------| 1- | P008 | MoneySense Magazine........... | N/A | 2021/11/11 | 2- | P008 | MoneySense Magazine........... | 72614 | 2021/11/16 | 3- | P008 | MoneySense Magazine........... | 48096 | 2021/11/17 | 4- | P008 | MoneySense Magazine........... | 89325 | 2021/11/17 | 5- | P008 | MoneySense Magazine........... | 33074 | 2021/11/17 | 6- | P008 | MoneySense Magazine........... | N/A | 2021/11/18 | 7- | P008 | MoneySense Magazine........... | 70451 | 2021/11/24 | 8- | S001 | Seneca Student Handbook....... | N/A | 2022/01/05 | > X (to Exit) > Row Number(select publication) > 8 | S001 | Seneca Student Handbook....... | N/A | 2022/01/05 | Remove this publication from the library? 1- Yes 0- Exit > 1 Publication removed 

The checkOutPub method

  • print: "Checkout publication from the library"
  • Search in available publications only
  • If the user selects a publication and confirms to checkout using the prompt: "Check out publication?"
    • read a 5 digit number from the console, if invalid print: "Invalid membership number, try again: " and read again
    • set the membership number of the selected publication the integer value.
    • set the changed flag to true
    • print: "Publication checked out"

Checking out a publication

Seneca Library Application 1- Add New Publication 2- Remove Publication 3- Checkout publication from library 4- Return publication to library 0- Exit > 3 Checkout publication from the library Choose the type of publication: 1- Book 2- Publication 0- Exit > 2 Publication Title: Sen Select one of the following found matches: Row |LocID | Title |Mem ID | Date | Author | ------+------+--------------------------------+-------+------------+-----------------| 1- | P008 | MoneySense Magazine........... | N/A | 2021/11/11 | 2- | P008 | MoneySense Magazine........... | N/A | 2021/11/18 | 3- | S001 | Seneca Student Handbook....... | N/A | 2022/01/05 | > X (to Exit) > Row Number(select publication) > 3 | S001 | Seneca Student Handbook....... | N/A | 2022/01/05 | Check out publication? 1- Yes 0- Exit > 1 Enter Membership number: 12345 Publication checked out 

The returnPub() Method

  • Print: "Return publication to the library"
  • Search for "on loan" publications only
  • If the user selects a publication and confirms the return using the prompt: "Return Publication?"
    • If the publication is more than 15 days on loan, a 50 cents per day penalty will be calculated for the number of days exceeding the 15 days.
      • Following message is printed: Please pay $9.99 penalty for being X days late!, 9.99 is replaced with the penalty value and X is replaced with the number of late days.
    • set the membership number of the publication to 0 (zero)
    • set the "changed" flag to true
    • print: "Publication returned"

Returning publication to library

Seneca Library Application 1- Add New Publication 2- Remove Publication 3- Checkout publication from library 4- Return publication to library 0- Exit > 4 Return publication to the library Choose the type of publication: 1- Book 2- Publication 0- Exit > 1 Publication Title: Harry Select one of the following found matches: Row |LocID | Title |Mem ID | Date | Author | ------+------+--------------------------------+-------+------------+-----------------| 1- | T343 | Harry Potter.................. | 65205 | 2021/11/19 | J. K. Rowling | 2- | C872 | Harry Potter and the Deathly H | 64984 | 2021/11/17 | J. K. Rowling | 3- | C332 | Harry Potter and the Half/Bloo | 85952 | 2021/11/22 | J. K. Rowling | 4- | D208 | Harry Potter and the Philosoph | 72685 | 2021/11/19 | J. K. Rowling | > X (to Exit) > Row Number(select publication) > 2 | C872 | Harry Potter and the Deathly H | 64984 | 2021/11/17 | J. K. Rowling | Return Publication? 1- Yes 0- Exit > 1 Please pay $4.00 penalty for being 8 days late! Publication returned 

The constructor

Add the following to the constructor:

  • Initialize and set the Publication Type Menu as described in the attributes section.
  • Add an argument to the constructor to receive the file name. Set the file name attribute to the incoming argument.

=======================================

MS5 Sample executionMilestone 5 Test One (m51)

Data file: LibRecsSmall.txt

  • load
  • Book and Publication entry
  • setting the library reference number
  • save

Data Entry:

1 1 S001 Book one 2020/10/10 John Doe 1 1 2 S002 Daily one 2020/10/10 1 0 1 

Milestone 5 Test Two (m52)

Data file: LibRecsSmall.txt

  • load
  • Removing Publication and Book
  • save

Data Entry:

2 1 e 3 1 2 2 e 3 1 0 1 

Milestone 5 Test Three (m53)

Data file: LibRecsSmall.txt

  • load
  • Checking out and no match found
  • Checking out with success
  • save

Data Entry:

3 1 Harry 3 1 Web 1 1 12345 0 1 

Milestone 5 Test Four (m54)

Data file: LibRecsSmall.txt

  • load
  • Returning a Book with no penalty
  • Returning a Book with penalty
  • Returning a Publication
  • save

Data Entry:

4 1 Harry 1 1 4 1 Hobbit 1 1 4 2 e 2 1 0 1 

Milestone 5 Test Five (m55)

Data file: LibRecs.txt

Before starting this this test make sure that in "Lib.h" The maximum capacity of the library is set to 333. >> const int SDDS_LIBRARY_CAPACITY = 333; <<

  • load
  • Adding a publication
  • Add another publication unsuccessfully
  • save

Data Entry:

1 2 S003 News Daily 2021/11/30 1 1 0 1 

Milestone 5 Test Six (m56)

Data file: LibRecs.txt

  • load
  • Aborting and error handling
  • exit without saving

Data Entry:

1 0 2 2  x 3 1  1 1 123456 12345 4 2  x 0 0 1 

======================== github link is here , only part 5 is needed https://github.com/Seneca-244200/OOP-Project#:~:text=Back%20to%20milestones-,Milestone%205,-The%20Seneca%20Library only part after

Publication* getPub(int libRef) method 

is needed https://gofile.io/d/VhXe0O all files you need can be downloaded here

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 Programming Questions!