Object-oriented programming is an approach to programming that groups similar kinds of things into a hierarchy of classes that share common data and methods.
To earn this badge, demonstrate your mastery of object-oriented programming in MiniScript with a program that includes the following:
You may write this program in any MiniScript environment you like. Submit your program to earn this awesome badge!
- An Animal class that defines a name property, an actVerb property equal to "walks", and an act verb that prints out a string that combines the name and the actVerb plus some string literals to print, for example: The animal walks around.
- A Bunny subclass of Animal. This should override actVerb with the value "hops".
- An instance of Bunny that is given a unique name, e.g. "Fluffy". Call the act method on this instance; it should print "Fluffy hops around."
- An additional subclass of either Animal or Bunny, of your own design. Demonstrate it by creating an instance and telling it to act.