We're going to build two classes. A Raccoon
class and a Puma
class.
-
Should have 4 attributes:
name
,age
,has_puma_bff?
, andpuma_points
. You can decide which data type each attribute should be. -
Should initialize with a unique name and an age.
-
Should automatically have a puma bff. Set the value
has_puma_bff?
during initialization. -
Starts without any
puma_points
. EachRaccoon
object has to be givenpuma_points
by their puma best friend. Set that value to zero at initialization. -
Should be able to talk to it's puma bff. Write a method that allows each raccoon to tell it's best friend, "I love you, Puma Best Friend."
-
Should be able to give
raccoon_points
to their puma bff. Create a method calledgive_raccoon_points
. This method should accept any argument (the instance of thePuma
class it'll give the points to) and should increment theraccoon_points
attribute of the instance of thePuma
class.
-
Should have 4 attributes:
name
,age
,has_raccoon_bff?
, andraccoon_points
. You can decide which data type each attribute should be. -
Should initialize with a unique name and an age.
-
Should automatically have a raccoon bff. Set the value
has_raccoon_bff?
during initialization. -
Starts without any
raccoon_points
. EachPuma
object has to be givenraccoon_points
by their raccoon best friend. Set that value to zero at initialization. -
Should be able to talk to it's raccoon bff. Write a method that allows each puma to tell it's best friend, "I love you, Raccoon Best Friend."
-
Should be able to give
puma_points
to their raccoon bff. Create a method calledgive_puma_points
. This method should accept any argument (the instance of theRaccoon
class it'll give the points to) and should increment thepuma_points
attribute of the instance of theRaccoon
class. -
Finally, Pumas need to be able to drop their best friend, and get another. Create a method called
drop_raccoon_bestie
. This method should accept an instance of theRaccoon
class as an argument. The body of the method should set thehas_puma_bff?
attribute of theRaccoon
class to false.
View Raccoons and Pumas, BFFAE on Learn.co and start learning to code for free.