Skip to main content

Practice · 1 of 3

Capstone seam 1: the borrow state machine

Complete BorrowTracker: bool borrow(const std::string& isbn) moves an available (or unknown) book to Borrowed and returns true — but returns false and changes nothing if it is already Borrowed. bool give_back(...) is the mirror for returning. bool is_borrowed(...) const reports state; unknown books are not borrowed.

Difficulty: intermediate

Back to lesson: Practice: Capstone seams