The protocol class is only giving me the protocols I need to implement in concrete classes in
Fantastic news! We've Found the answer you've been seeking!
Question:
- The protocol class is only giving me the protocols I need to implement in concrete classes in another file (dessert.py). The freezer class contains methods that if the put() method gets called then it also calls the chill(). The take() calls the thaw().
- In my second file (dessert.py), where my concrete classes are, the goal is to call the features of the protocol: chill(), thaw(), and temperature(). The method temperature() should be default be 'thaw' but if put() gets called on an instance of Cookie, then the temperature should now return to 'chilling', and if take() gets called on the same instance, then temperature() should now return 'thawing'.
- The instantiation of the Cookie class, the Freezer class, and calling the method for temperature() and put() are coded in a third file called dessertshop.py
- The goal is to create "my_cookie" and the temperature should by default be 'thawing' but once I call freezer.put(my_cookie) the print statements for temperature() should change to 'chilling'.
- I believe my temperature() method in dessert.py is incorrect. Can you help me understand how I can make temperature() change its return every time either put() or take() are implemented on an instance of a dessert?
Related Book For
Management Accounting Information for Decision-Making and Strategy Execution
ISBN: 978-0137024971
6th Edition
Authors: Anthony A. Atkinson, Robert S. Kaplan, Ella Mae Matsumura, S. Mark Young
Posted Date: