Question: Hello, i cant seem to figure out why my code wont compile in c + + . The error seems to be pertaining to the
Hello, i cant seem to figure out why my code wont compile in c The error seems to be pertaining to the Patron Lib class but i cant figure it out. can you help please. Pics provided due to character limit
ADDITIONAL SECTIONS OF CODE PROVIDED IN TEXT BELOW.
LoanLib.cpp:
#include
#include
#include "LoanLib.h
void LoanLib::checkOutBookint bookID, int patronID
try
Book book books.findBookbookID;
Patron patron patrons.findPatronpatronID;
if patrongetCurrentBooksOut && book.getStatusIn
Loan newLoanloanssize bookID, patronID, time "Normal";
loanspushbacknewLoan;
booksetStatusOut;
bookseditBookbookID book;
patronsetCurrentBooksOutpatrongetCurrentBooksOut;
patronseditPatronpatronID patron;
else
cout "Cannot checkout book. Limit Reached or book unavailable." endl;
catch exception &e
cout ewhat endl;
void LoanLib::checkInBookint loanID
auto loanIt findifloansbegin loans.end
loanIDLoan &l return lgetLoanID loanID; ;
if loanIt loans.end
Loan loan loanIt;
Book book books.findBookloangetBookID;
Patron patron patrons.findPatronloangetPatronID;
booksetStatusIn;
bookseditBookloangetBookID book;
patronsetCurrentBooksOutpatrongetCurrentBooksOut;
patronseditPatronloangetPatronID patron;
loanseraseloanIt;
else
cout "Loan not found!" endl;
void LoanLib::OverdueLoans
timet now time;
for auto &loan : loans
if loangetDueDate now
cout "Loan ID: loan.getLoanID is overdue" endl;
void LoanLib::BooksForPatronint patronID
for auto &loan : loans
if loangetPatronID patronID
cout "Book ID: loan.getBookID endl;
void LoanLib::updateLoan
timet now time;
for auto &loan : loans
if loangetDueDate now && loan.getStatus "Normal"
loansetStatusOverdue;
void LoanLib::recheckBookint loanID
auto loanIt findifloansbegin loans.end
loanIDLoan &l return lgetLoanID loanID; ;
if loanIt loans.end
Loan loan loanIt;
if loangetStatus "Normal"
loansetDueDateloangetDueDate;
else
cout "Cannot recheck overdue book" endl;
else
cout "Loan not found!" endl;
void LoanLib::editLoanint loanID, const Loan &newDetails
auto loanIt findifloansbegin loans.end
loanIDLoan &l return lgetLoanID loanID; ;
if loanIt loans.end
loanIt newDetails;
else
cout "Loan not found!" endl;
void LoanLib::reportLostBookint loanID
auto loanIt findifloansbegin loans.end
loanIDLoan &l return lgetLoanID loanID; ;
if loanIt loans.end
Loan loan loanIt;
Book book books.findBookloangetBookID;
Patron patron patrons.findPatronloangetPatronID;
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
