Question: Define a class TaskCalculator ( ) to keep track of how much time a day's tasks will likely take. The class has a single

Define a class TaskCalculator ( ) to keep track of how much 

Define a class TaskCalculator ( ) to keep track of how much time a day's tasks will likely take. The class has a single attribute, daily tasks, which is created as an empty dictionary using the classes' initializer function It will then have two methods: add_task and calculate_time. add_task (task, duration) : input parameters task (a string) duration (an int or float describing the number of hours) this method will add an entry to the daily tasks dictionary, using task as the key and duration as the value calculate_time(): no input parameters the code will then determine, given the values in the instance attribute daily_tasks, how long the daily_tasks are estimated to take by summing up the dictionary values the number of hours estimated should be returned from this method if no tasks are stored then the return value should be 0 Activate Mi

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

To define the TaskCalculator class as per the given requirements you can use the following code pyth... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!