Find Jobs
Hire Freelancers

Library Simulator

$10-30 USD

Completed
Posted almost 9 years ago

$10-30 USD

Paid on delivery
Library simulator will have 3 classes: Book, Patro, Library. You will write the three implementation files. You may add 1-line "inline function" implementations to the .hpp files, but implementation of the other functions should go in the corresponding .cpp files. Please put your function comments in the .cpp files. HPP files provided Book: idCode - a unique identifier for a Book title - cannot be assumed to be unique author - the title and author don't need set methods, since they will never change after the object has been created, therefore these fields can be initialized directly within the constructor location - a Book can be either on the shelf, on the hold shelf, or checked out checkedOutBy - pointer to the Patron who has it checked out (if any) requestedBy - pointer to the Patron who has requested it (if any); a Book can only be requested by one Patron at a time dateCheckedOut - when a book is checked out, this will be set to the currentDate of the Library CHECK_OUT_LENGTH - constant that gives how long a Book can be checked out constructor - takes an idCode, title and author; checkedOutBy and requestedBy should be initialized to NULL; a new Book should be on the shelf some get and set methods Patron: idNum - unique identifier for a Patron name - cant be assumed to be unique checkedOutBooks - a vector of Books that Patron currently has checkedOut fineAmount - how much the Patron owes the Library in late fines; allowed to go negative a constructor that takes an idNum and name some get and set methods addBook - adds the specified Book to checkedOutBooks removeBook - removes the specified Book from checkedOutBooks amendFine - a positive argument increases fineAmount, a negative one decreases it Library: holdings - a vector of pointers to Books in Library members - a vector of pointers to Patrons in Library currentDate - stores the current date represented as an integer number of "days" since the Library object was created a constructor that initializes the currentDate to zero addBook - adds the parameter to holdings addPatron - adds the parameter to members getBook - returns a pointer to the Book corresponding to the ID parameter, or NULL if no such Book is in the holdings getPatron - returns a pointer to the Patron corresponding to the ID parameter, or NULL if no such Patron is a member checkOutBook if specified Book is not in the Library, return "book not found" if specified Patron is not in the Library, return "patron not found" if specified Book is already checked out, return "book already checked out" if specified Book is on hold by another Patron, return "book on hold by other patron" otherwise update the Book's checkedOutBy, dateCheckedOut and Location; if the Book was on hold for this Patron, update requestedBy; update Patron's checkedOutBooks; return "check out successful" returnBook if specified Book is not in the Library, return "book not found" if Book is not checked out, return "book already in library" update Patron's checkedOutBooks; update the Book's location depending on whether another Patron has requested it; update the Book's checkedOutBy; return "return successful" requestBook if specified Book is not in the Library, return "book not found" if specified Patron is not in the Library, return "patron not found" if specified Book is already requested by another Patron, return "book on hold by other patron" update the Book's requestedBy; if the Book is on the shelf, update its location to on hold; return "request successful" payFine if the specified Patron is not in the Library, return "patron not found" use amendFine to update the Patron's fine; return "payment successful" incrementCurrentDate increment current date; increase each Patron's fines by 10 cents for each overdue Book they have checked out (using amendFine) be careful - a Book can be on request without its location being the hold shelf (if another Patron has it checked out); ***must pass using python test file using provided main file
Project ID: 7813566

About the project

2 proposals
Remote project
Active 9 yrs ago

Looking to make some money?

Benefits of bidding on Freelancer

Set your budget and timeframe
Get paid for your work
Outline your proposal
It's free to sign up and bid on jobs
Awarded to:
User Avatar
Hi there, After reading your project description it looks like you require a library simulator to be implemented in C++. The simulator must use the provided .hpp files (for Book, Patron and Library) as well as conform to the class design mentioned in the project description. The simulator must also pass the python test provided (which uses libMain.o). I have over 5 years of experience in creating C++ solutions so this project would be no problem for me. I could complete it within a couple of hours. Regards, John
$30 USD in 0 day
5.0 (11 reviews)
3.3
3.3
2 freelancers are bidding on average $30 USD for this job
User Avatar
Hi, I have read the requirements and I would like to do this project please. Let me know if you are interested so I can start. Thanks.
$30 USD in 3 days
5.0 (631 reviews)
7.2
7.2

About the client

Flag of UNITED STATES
fremont, United States
5.0
13
Payment method verified
Member since Mar 10, 2015

Client Verification

Thanks! We’ve emailed you a link to claim your free credit.
Something went wrong while sending your email. Please try again.
Registered Users Total Jobs Posted
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Loading preview
Permission granted for Geolocation.
Your login session has expired and you have been logged out. Please log in again.