Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Task 01 (10 points) This assignment will be incredibly open ended, this is by design. I want you to have some freedom to create something
Task 01 (10 points) This assignment will be incredibly open ended, this is by design. I want you to have some freedom to create something that you are interested in rather than just following along with what I tell you to do. Feel free to go as far as you'd like with your script, don't just stop with the bare minimum. And remember to have fun! Scripts will be graded on how much fun you have. Create a class of your choosing. It can be an animal class or a bankaccount class. Choose something that you are passionate about and familiar with and create it. For the purposes of illustration, I will be using a dog class as an example. While I would prefer you to create your own unique class, you may use a dog class so long as you do not copy my code and you are super passionate about dogs. Your class should have the following: - Three protected class variables to store key information about the class - An __init__ constructor that populates the aforementioned class variables Example structure class Dog: size = smol rate = 10 name = Schmoopy _init__(size, rate, name): size = size rate = 10 name = name Task 02 (10 points) Now it's time to add some interactivity to your previous script. Take the class you created in the add the following: - One method that will accept an input, update one of the class variables, and return the new value - One method that will accept an input, perform some kind of error checking, update one of the class variables, and return the new value Example structure set_size(newsize): size = newsize return size increment_cute(number): if rate 8: return false else: rate += number return rate wrinkles = 25 wrinkle(newwrinkles): if wrinkles + newwrinkles
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started