Bummer! This is just a preview. You need to be signed in with an account to view the entire instruction.
- Explanation: Revisiting the checkOut() and returnBook() Methods 1:42
- Solution: checkOut() and returnBook() Methods
- Explanation: A Better Way With Setters Methods 1:32
- Recap: A Better Way With Setter Methods
- Solution: A Better Way With Setter Methods
- Demo: Checking Out and Returning a Book 2:07
- Explanation: Charging Fines to Patrons 0:40
- Recap: Charging Fines to Patrons
- Solution: Charging Fines to Patrons
- Demo: Charging Fines to Patrons 2:34
- Checking Out and Returning a Book 3 questions
Instruction
Solution: checkOut() and returnBook() Methods
Solution for the checkOut() Method
The checkOut() method in the Patron class is how we’re modeling the process of a real-life Library patron checking out a book.
It sets the currentBook property on the Patron object to the Book object they’re checking out. It also sets the patron property on the Book object to the Patron that’s borrowing the book.
The out property on the Book object is set...