Exercises
Classes, objects, and enums are great for enhancing our Mesozoic Eden software. In these exercises, you will be creating classes to represent different entities in our park and using enums to define fixed sets of constants:
- We have many types of dinosaurs in our park, each with unique characteristics. Define a class called
Dinosaur
with properties such as name, age, and species. - Our park’s heart and soul lie in its employees. Create a class called
Employee
that encapsulates properties such as name, job title, and years of experience. - With these classes in place, create some instances of
Dinosaur
andEmployee
and practice manipulating these objects. It’s hard for me to provide more details for this exercise, but for example, you could create a new class calledApp
. Then, in this class, you could create a few instances ofDinosaur
andEmployee
. If you want to go wild, you can add a method that takesDinosaur
as an argument and then prints the...