Mei’s tracker works. Your Plant class keeps each plant’s day count private and rejects a negative interval, and your Shelf lists the plants that need water and handles her weekend-away watering without losing this. The tests say so. However, passing tests only shows what your code does. When the next bug isn’t one you’ve seen before, you’ll need to say why it does it.
In this review, you’ll explain your tracker to the mentor, one question at a time, and then change it to handle something the brief didn’t ask for. You’ll show that you can say what this is in each call your tracker makes, why Mei’s original weekend-away script broke, and how your classes protect her data. Start by getting your code ready to share.
Talk Through Your Tracker
The mentor needs your code in front of it. Have your solutions from Exercise: Build the Plant Class and Exercise: Fill and Water the Shelf open so you can copy the Plant class, the Shelf class, and waterBeforeTrip() into the chat. If you’ve also saved them in your plant-tracker folder, keep a terminal open there too. The mentor can’t run code, but you can, with node.
The button below opens the mentor in a new conversation and sends the opening line for you. The mentor asks for your code, then questions you about it the way a friend reading it might. It asks which kind of member you chose for each part of a plant and why, what a line will print, and which object this is in a call.