Question: Here's a long one you can do itl Rewrite the following class so that it uses getters and Setters for all three variables (title, description

 Here's a long one you can do itl Rewrite the followingclass so that it uses getters and Setters for all three variables

Here's a long one you can do itl Rewrite the following class so that it uses getters and Setters for all three variables (title, description , #completed). The getters should be called: getTitle, getDescription, getcompleted. The setters should be #called: setTitle, setDescription, setCompleted. Whenever a getter is called, the method should print For example, when calling " accessed". getTitle(), the program should print "title accessed" Whenever a setter is called, the method should print " changed. For example, when calling the method setCompleted (True), the program should print #"completed changed". #1n addition, the setter should check to make sure that the new value is the correct type: title and description of type str, and completed should always bool. If the value is not the right type, be of type print "invalid value in addition to " #changed", and set the value of the corresponding attribute to None (the keyword, not the string "None Note that when assigning variables their initial values inside the constructor, you should use the getters and setters, not modify the variables directly. #70 summarize (and give a to-do list): -create getters and setters for each variable. -Print a log statement when the getters and setters are called. - Check the type of the new value inside the setters, and print an error if it's the wrong type -Modify the constructor body to use the getters and/or # setters instead of assigning values directly. See the bottom of the code for hints

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock 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 Databases Questions!