Project – dinosaur care system
Running a dinosaur park is filled with unexpected situations. Some are minor, such as running out of cheese-flavored potato chips. Some are major, such as an escaped T-Rex. The happiness, health, and safety of our dinosaurs and visitors are important, so our system should be able to handle exceptional situations.
Design a “dinosaur care system” for Mesozoic Eden that handles exceptional situations such as a dinosaur falling ill, enclosure breaches, and so on. Use appropriate exceptions to represent various error conditions and handle them properly.
Here are the steps to do this:
- Set up your project:
- Create a new Java project in your IDE of choice.
- Create a new package named exception.
- Create custom exceptions:
- Create a new class called
DinosaurIllException
inside the exception package. This class should extend theException
class and represent an error condition when a dinosaur falls ill. - Similarly, create
EnclosureBreachedException...
- Create a new class called