Starting from:

$30

IT210- Fundamentals of Programming Lab 8 Solved

Instructions
You will work with a partner or two to implement the Toy class. Attributes to be included:

You should have an instance variable for at least each of the following attributes:

o         toy name o price o most likely to be interesting for boy, girl, either  minimum recommended age

Additional attributes can be added if you wish. Methods to be included:

init       (self, name) # only the name is part of the initial toy creation. Other attributes are added later but you should give them defaults in the constructor.

o         setPrice and getPrice

o         setGender, getGender (you get to design how to handle this)  setMinAge and getMinAge repr__ Compactly represent all the attributes above as a single string

Add additional methods as necessary for any additional attributes that you added.

Test Code
Include test code in an if name main . section at the end of your file. The quality and completeness of your test code will be considered when your lab is graded. Every method should be exercised by the test code.

More products