Skip to content

ThiagoGoncos/CCT-java-zoo-management-system

Repository files navigation

Zoo Management System

Project Overview

This project was developed as part of the Bachelor of Science in Computing and Information Technology at CCT College Dublin.

The objective of this project was to design and implement a console-based Zoo Management System using Java. The application allows users to manage animals in a zoo through a menu-driven interface, including listing animals, listing animal categories, searching animals by ID, adding new animals, editing animal information, retrieving a random animal, and checking sick animals under veterinary care.

The project was developed using object-oriented programming principles, including inheritance, encapsulation, interfaces, modular design, and collection-based data management. The system was also improved with better animal categorisation, dynamic creation of animal types, input validation, and veterinary support.


Project Objectives

The main objectives of this project were:

  • To design a modular zoo management application in Java
  • To apply object-oriented programming concepts in a practical scenario
  • To manage animals using structured classes and inheritance
  • To organize zoo animals by category using collections
  • To allow users to add, search, edit, and display animal records
  • To validate user input and reduce runtime errors
  • To support veterinary tracking for sick animals
  • To build a system that could be extended and improved in future versions

System Architecture

The system is organised into multiple packages to separate responsibilities and improve maintainability.

The main conceptual modules are:

  • AnimalSettings – animal classes and inheritance hierarchy
  • EmployeeSettings – veterinary management
  • ZooSettings – main zoo interface and implementation
  • MainMenu – application entry point and console menu
  • IOUtils – input validation utilities

This modular architecture improves code readability, scalability, and maintenance.


Core Features

The Zoo Management System supports the following core features:

  • List all animals grouped by category
  • List all animal types currently registered in the zoo
  • Search for an animal by its unique ID
  • Add a new animal to an existing or newly created category
  • Edit animal information by ID
  • Display a random animal from the zoo
  • Track and display sick animals in veterinary care
  • Validate user input before processing operations

Animal Management

The system uses a base Animal class to represent general animal data.

Each animal stores the following main attributes:

  • ID
  • Species
  • Name
  • Age
  • Weight
  • Habitat
  • Behaviour
  • Diet type
  • Fertility status
  • Endangered status
  • Origin
  • Zoo location
  • Sick status

Each animal receives an auto-incremented unique ID when created.

The Animal class also supports dynamic custom attributes using a HashMap<String, String>, allowing the system to be extended more easily in future versions.


Animal Inheritance Structure

The project applies inheritance to model different types of animals.

Base Class

  • Animal

Main Subclasses

  • Mammal
  • Bird
  • Fish

More Specific Subclasses

  • AquaticMammal
  • TerrestrialMammal
  • FlyingBird
  • FlightlessBird
  • FreshwaterFish
  • SaltwaterFish

This structure improves object-oriented design and allows the system to represent real-world animal differences more clearly.

Subclass-Specific Attributes

The main specialised attributes include:

  • MammalisAquatic
  • BirdcanFly
  • FishisFreshwater

This modelling makes the system more realistic and easier to extend.


Zoo Management Logic

The system uses a Zoo interface and a concrete implementation class called ZooImp.

The Zoo interface defines the main operations of the system, such as:

  • listing all animals
  • listing all animal types
  • adding animals
  • editing animals
  • retrieving a random animal
  • adding new animal categories
  • sending sick animals to veterinary
  • searching animals by ID

The ZooImp class implements these behaviours and manages animal storage using:

  • HashMap<String, List<Animal>>

This allows animals to be grouped dynamically by category, making the system flexible and scalable.


Dynamic Animal Categories

One of the important improvements in the project is the ability to create new animal categories dynamically.

When the user tries to add an animal to a category that does not yet exist, the system gives the option to create that category at runtime.

This makes the application more flexible because new categories can be introduced without changing the source code structure.


Predefined Zoo Data

When the system starts, ZooImp loads a few predefined animals to demonstrate functionality.

Examples include:

  • an aquatic mammal
  • a flying bird
  • a freshwater fish

One predefined animal is also marked as sick and automatically added to the veterinary list, demonstrating interaction between the zoo management module and the veterinary module.


Animal Editing Functionality

The system includes an editAnimal feature that allows users to update an animal by entering its ID.

Editable attributes include:

  1. Species
  2. Name
  3. Age
  4. Weight
  5. Habitat
  6. Behaviour
  7. Diet Type
  8. Fertile
  9. Endangered
  10. Origin
  11. Zoo Location
  12. Sick Status

This feature improves usability by allowing corrections and updates without recreating the animal record.


Search and Retrieval Features

The application includes multiple ways to retrieve animal data:

Get Animal by ID

Users can enter a unique animal ID to search for a specific animal.

Get Random Animal

The system can randomly select and display one animal from all stored animals.

These features improve navigation and make the console application more practical to use.


Veterinary Management

The system includes a Veterinary class responsible for managing sick animals.

Its main responsibilities include:

  • receiving sick animals
  • storing them in a separate veterinary list
  • listing all animals currently under care
  • showing basic information about animals under treatment

When an animal is added or edited and marked as sick, it can be sent to the veterinary system automatically.

This feature demonstrates communication between system modules and adds a practical animal health management component.


User Input Validation

The project includes an IOUtils utility class to validate user input.

Supported validation includes:

  • text-only input
  • text with letters and numbers
  • integer input
  • positive decimal input
  • boolean input using yes/no

This reduces invalid input and helps prevent crashes or inconsistent data entry.


Menu System

The application uses a console-based menu interface through the MainMenu class.

The current menu options are:

  1. List all animals
  2. List all animal types
  3. Get animal by ID
  4. Add a new animal
  5. Edit an animal
  6. Get a random animal
  7. Check sick animals at veterinary
  8. Exit

The menu runs continuously until the user chooses to exit the application.


Technologies Used

Java

The project was developed using Java and applies the following programming concepts:

  • Classes and objects
  • Inheritance
  • Encapsulation
  • Interfaces
  • Collections (HashMap, ArrayList)
  • Input validation
  • Modular package organisation
  • Console-based user interaction

System Improvements Implemented

Compared to a simpler initial version, this project introduces several important improvements:

1. New Animal Attributes

The Animal class was expanded with more realistic zoo-related properties such as habitat, behaviour, diet type, fertility, endangered status, origin, and zoo location.

2. Dynamic Creation of Animal Types

The system can create new categories at runtime without modifying the class structure.

3. Inheritance and Encapsulation

The project uses inheritance for animal specialisation and keeps attributes private with controlled access through getters and setters.

4. Animal Editing

Animals can be updated through an ID-based editing feature.

5. Error Handling

Input validation improves reliability and reduces invalid entries.

6. Enhanced Menu Interaction

The menu offers more complete user interaction, including editing, searching, and veterinary checking.

7. Veterinary Support

The application tracks sick animals separately for easier health management.

8. Modular Code Organisation

The project is separated into packages, making it easier to maintain and extend.


System Limitations

Although the current system is functional, it still has some limitations:

  • Data is not stored permanently after the program closes
  • Veterinary records do not include treatments or medical history
  • There are no graphical dashboards or reports
  • The system runs only in the console
  • Advanced analytics are not included

Possible Future Improvements

The report suggests several possible future improvements, including:

  • database integration for permanent storage
  • enhanced veterinary records and treatment tracking
  • better reporting and analytics
  • graphical user interface
  • improved search and navigation features
  • stronger logging and error handling mechanisms

These enhancements would make the system more suitable for larger and more complex zoo operations.


Learning Outcomes

This project demonstrates important concepts in software design and development, including:

  • object-oriented programming
  • inheritance and polymorphism
  • interface-based architecture
  • data organisation with collections
  • modular program design
  • user input validation
  • menu-driven application design
  • practical problem solving in Java

The system models a realistic management scenario and provides a strong foundation for future expansion.


Repository Structure

This repository may include files such as:

  • Animal.java
  • Mammal.java
  • Bird.java
  • Fish.java
  • AquaticMammal.java
  • TerrestrialMammal.java
  • FlyingBird.java
  • FlightlessBird.java
  • FreshwaterFish.java
  • SaltwaterFish.java
  • Veterinary.java
  • Zoo.java
  • ZooImp.java
  • IOUtils.java
  • MainMenu.java
  • project report documentation

Conclusion

The Zoo Management System is a modular Java console application designed to support core zoo operations through structured animal management, category organisation, veterinary tracking, and user-friendly menu interaction.

The project demonstrates strong use of object-oriented programming, modular package organisation, and practical Java development techniques. It also provides a solid base for future improvements such as database support, richer veterinary features, and a graphical user interface.


Author

This project was developed by Thiago Goncalves da Costa as part of the Bachelor of Science in Computing and Information Technology at CCT College Dublin.

During my studies, I used the institutional GitHub account associated with my student email:
2022161@student.cct.ie

Since institutional accounts and student emails may be deactivated after graduation, this repository was migrated to my personal GitHub account:
https://github.com/ThiagoGoncos

This ensures long-term preservation of the project, commit history, and academic work completed during the degree program.

About

Object-oriented Java console application that simulates a zoo mgmt system where users manage different animal types (mammals, birds & fish). The project demonstrates OOP concepts like inheritance, interfaces, encapsulation, & class interaction. Manages animals, employees & veterinary operations for Object-Oriented Programming module at CCT College.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages