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: A Better Way With Setter Methods
Solution for the Setter Method
The setter method, called out(), should receive one argument (this can also be called out, or any other variable name that makes sense to you). This argument is the value that the _out backing property will be set to - true or false. The Book object either is, or isnβt checked out.
This setter method is also meant to calculate the Bookβs due date. If the book i...