Difference between revisions of "Java Desktop App - Zoo Management System"

From Sinfronteras
Jump to: navigation, search
Line 5: Line 5:
  
  
*<span style="background:#D8BFD8">'''The system must allow a user to:'''</span>
+
The system allow a user to:
**Search for Animals.
+
*Search for Animals.
**Search for Keepers.
+
*Search for Keepers.
**Add new animals.
+
*Add new animals.
**Add new keepers.
+
*Add new keepers.
**Update animals.
+
*Update animals.
**Update keepers.
+
*Update keepers.
 
 
 
 
  
  
  
 +
The Zoo has a number of Animals. These Animals are broken down into types:
 +
*Mammal
 +
*Reptile
 +
*Avian
 +
*Aquatic
 +
*Insect
  
You have been tasked to create a Zoo management system.
 
  
*<span style="background:#D8BFD8">'''The Zoo has a number of Animals. These Animals are broken down into types:'''</span>
 
**Mammal
 
**Reptile
 
**Avian
 
**Aquatic
 
**Insect
 
  
 
:*'''Example Animals:'''
 
:*'''Example Animals:'''
Line 37: Line 34:
 
::::*Bat
 
::::*Bat
 
:::::*date of birth, date of arrival, fight, gender, ofspring, medication, vaccine, exhibit number
 
:::::*date of birth, date of arrival, fight, gender, ofspring, medication, vaccine, exhibit number
 +
  
  
Line 55: Line 53:
 
*<span style="background:#D8BFD8">'''Your system must be run on test data before the Zoo will accept it:'''</span>
 
*<span style="background:#D8BFD8">'''Your system must be run on test data before the Zoo will accept it:'''</span>
  
:You are required to have a data set of at least 100 animals and 40 zoo keepers.
+
 
 +
You are required to have a data set of at least 100 animals and 40 zoo keepers.
 +
 
  
 
==Requirements gathering and analysis==
 
==Requirements gathering and analysis==

Revision as of 14:17, 1 July 2019

Project description

In this project, we have created a Zoo management system using Jave -

Our Management System allow to manage Animals and Zoo Keepers. Some of the functionalities that have been added to the system are:


The system allow a user to:

  • Search for Animals.
  • Search for Keepers.
  • Add new animals.
  • Add new keepers.
  • Update animals.
  • Update keepers.


The Zoo has a number of Animals. These Animals are broken down into types:

  • Mammal
  • Reptile
  • Avian
  • Aquatic
  • Insect


  • Example Animals:
  • Mammal:
  • Tiger:
  • date of birth, date of arrival, gender, ofspring, medicaton, vaccine, exhibit number
  • Mammal:
  • Avian
  • Bat
  • date of birth, date of arrival, fight, gender, ofspring, medication, vaccine, exhibit number


  • Each Animal has a Zoo keeper that looks afer it:
    • Zoo keepers are only allowed to care for animals if they are qualified to do so.
    • A zoo keeper can look afer a max of 3 Animal types for a max of 10 animals.


  • The system must allow a user to:
    • Search for Animals.
    • Search for Keepers.
    • Add new animals.
    • Add new keepers.
    • Update animals.
    • Update keepers.


  • Your system must be run on test data before the Zoo will accept it:


You are required to have a data set of at least 100 animals and 40 zoo keepers.


Requirements gathering and analysis

Classes diagram

Class diagram1


An example of one of the classes

public class Test {
    
    public static void main(String[] args) {
        Cat c = new Cat();
        System.out.println(c.health);
        
        Dog d = new Dog();
        System.out.println(d.health);
        
        
        // // Upcasting
        Mammal m = c;           // Although there's no need to for programmer to upcast manually, it's legal to do so:
                                // Mammal m = (Mammal) new cat();
                                
        System.out.println(c);  // This print:               upcastingdowncasting.Cat@15db9742                               
        System.out.println(m);  // This will print the same: upcastingdowncasting.Cat@15db9742
                                // As you can see, Casting does not change the actual object type
                                // Cat is still exactly the same Cat after upcasting.
                                // It didn't change to a Mammal, it's just being labelled Mammal right now.
                                // This is allowed, because Cat is a Mammal.
        
                                        
        // // Downcasting
        if(m instanceof Cat){   // testing if the Animal is a Cat
            System.out.println("It's a Cat! Now I can downcast it to a Cat, without a fear of failure.");
            Cat c1 = (Cat)m;    // Manual downcasting back to a Cat
        }
        
        // The following code will compile, but throws "java.lang.ClassCastException: Mammal cannot be cast to Cat" exception during runTime,
        // because I’m trying to cast a Mammal, which is not a Cat, to a Cat.
        Mammal m1 = new Mammal();
        Cat    c2 = (Cat)m1;                        
                                
    }
    
}


Description of the GUI


ZooManagementSystem GUI 1.png


ZooManagementSystem GUI 2.png


ZooManagementSystem GUI 3.png


ZooManagementSystem GUI 4.png


ZooManagementSystem GUI 5.png


ZooManagementSystem GUI 6.png