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
Dinosaurwith properties such as name, age, and species. - Our park’s heart and soul lie in its employees. Create a class called
Employeethat encapsulates properties such as name, job title, and years of experience. - With these classes in place, create some instances of
DinosaurandEmployeeand 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 ofDinosaurandEmployee. If you want to go wild, you can add a method that takesDinosauras an argument and then prints the...